原生脚本中的 Vue

Vue in nativescript

在 nativescript vue 中是否可以在另一个组件中包含一个组件? 喜欢父子关系

像这样:

<Frame ~mainContent>
    <Page>
        <ActionBar title="Initial Page" style="color:white">
            <NavigationButton icon="res://menu" @tap="openMenu"></NavigationButton>
        </ActionBar>

        <StackLayout>
           <son-component></son-component>
        </StackLayout>
    </Page>
</Frame>

这应该可以做到。您需要注册子组件

<Frame ~mainContent>
    <Page>
        <ActionBar title="Initial Page" style="color:white">
            <NavigationButton icon="res://menu" @tap="openMenu"></NavigationButton>
        </ActionBar>

        <StackLayout>
           <Son></Son>
        </StackLayout>
    </Page>
</Frame>

<script >
import Son from "./son-component";

  export default {
    components: {
    Son,
  },
    props: {

  },
  data() {

  }
}
</script>