<script type="text/javascript"> var 组件名 = { template: "<button @click='btnClick'>{{ num }}</button>", data: function() { return{ num : 0 } }, methods:{ btnClick: function(){ this.num++; } } } new Vue ({ el: '#app', components: { 组件名 } }) </script>
局部组件
猜你喜欢
转载自www.cnblogs.com/zhaijihai/p/9883658.html
今日推荐
周排行