如何在vue内联模板中使用嵌套的组件变量?

时间:2019-03-19 04:20:44

标签: laravel vuejs2 vue-component laravel-blade

我在Laravel后端填充的刀片模板中有类似的内容:

<component-1 inline-template>
    <child-component-1 v-show='comps.cc1'></child-component-1>
    <child-component-2>
        <grandchild-component-1 v-show='subComps.cc1></grandchild-component-1>
        <grandchild-component-2 v-show='subComps.cc2></grandchild-component-2>
    </child-component-2>
</component-1>

comps 对象引用了 component-1 中的变量,这没关系,但是 subComps 对象正在尝试引用中的变量。以及 component-1 ,我希望它引用 child-component-2 中的变量。

我该如何实现?

谢谢。

0 个答案:

没有答案