const CounterComponent = Vue.extend(Counter);
this.vm = new CounterComponent({}).$mount('#container');
其中 Counter 是引进来的组件
this.vm是引进来的组件生成的vue实例
我们可以通过this.vm.xx来直接控制Counter中的data中的数据
长风破浪会有时,直挂云帆济沧海
vue中使用vue.extend在dom挂载vue实例
阅读 69
2022-07-27
const CounterComponent = Vue.extend(Counter);
this.vm = new CounterComponent({}).$mount('#container');
其中 Counter 是引进来的组件
this.vm是引进来的组件生成的vue实例
我们可以通过this.vm.xx来直接控制Counter中的data中的数据
长风破浪会有时,直挂云帆济沧海
相关推荐
精彩评论(0)