Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a way to pass a native view reference to parent component as a prop #80

Closed
@rigor789

Description

@rigor789

There are many UI plugins that require passing in a view as a property, in xml this is achieved the following way:

<nsDrawer:RadSideDrawerid="sideDrawer">  <nsDrawer:RadSideDrawer.drawerContent>    <StackLayout><!-- etc-->    </StackLayout>  </nsDrawer:RadSideDrawer.drawerContent></nsDrawer:RadSideDrawer>

When registering custom UI elements that use the same approach, the problem is that in ns-vue

<RadSideDrawerid="sideDrawer"><StackLayout><!-- etc --></StackLayout></RadSideDrawer>

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 defaultv-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

<RadSideDrawerid="sideDrawer"><StackLayoutv-view:drawerContent><!-- etc --></StackLayout></RadSideDrawer>

And it would probably make sense to add a shorthand version as well

<RadSideDrawerid="sideDrawer"><StackLayout~drawerContent><!-- etc --></StackLayout></RadSideDrawer>

Leave your suggestion as a comment to what the name of the directive should be!

My initial idea isv-view:parentPropName,~parentPropName for the shorthand version.

Checklist

  • Addv-view directive and~ as the alias
  • Document usage in docs
  • Decide ifv-view is the right name for the directive.
  • Add.array modifier
  • Add array mode shorthand alias

Allow 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:

<Parent>  <Child ~parentProp.array />  <Child ~parentProp.array />  <Child ~parentProp.array /></Parent>

The long syntax would use a directive modifier:v-view:prop.array.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp