-
-
Notifications
You must be signed in to change notification settings - Fork 244
Add a way to pass a native view reference to parent component as a prop #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Allows child elements to set "themselves" as an attribute value on the parent.
You can play around with the directive in this playground: https://play.nativescript.org/?template=play-vue&id=5A3eP-ShmM0QEHiMDDfY0 |
You're reading in my mind! I just tried to integrate the RadSideDrawer and I found the need of a directive. Yours is working really well! Good work! Did you find a way to put the RadSideDrawer inside a Page with an ActionBar (and so a button to open the drawer)? |
You can add an action bar if you wrap the RadSideDrawer in a Page. https://play.nativescript.org/?template=play-vue&id=6o7FUvfPHw04BqIOY5sz |
Oh fine it works! Don't know what I did wrong when I tested it. |
I am on android, once I press the button "back" and that the application is found in pause "onPause ()", and then I click on the icon of the application to engage "surResume ()" then the application bug. Once stop "onStop ()", click on the icon while it normally starts. Bug related to the life cycle of an Android application. |
There are many UI plugins that require passing in a view as a property, in xml this is achieved the following way:
When registering custom UI elements that use the same approach, the problem is that in ns-vue
tries to append the StackLayout as a child element, and results in nothing displaying.
My initial idea is to add a custom directive that will handle this, using a similar syntax to the default
v-bind:
,:
orv-on
,@
directives.Naming things is hard, so please help me find a good name and syntax for the proposed directive.
The new syntax would look something like
And it would probably make sense to add a shorthand version as well
Leave your suggestion as a comment to what the name of the directive should be!
My initial idea is
v-view:parentPropName
,~parentPropName
for the shorthand version.Checklist
v-view
directive and~
as the aliasv-view
is the right name for the directive..array
modifierAllow setting a parent array property
So looks like we need to allow multiple children to be added to the parent's prop using an array. Either extend the module to detect arrays (this will likely break in many cases), or create a dedicated directive for setting the array.
Possible short syntax:
~~
,~[]
,~.array
etc (comment below if you have an idea)Example:
The long syntax would use a directive modifier:
v-view:prop.array
.The text was updated successfully, but these errors were encountered: