页面组件化
1. 基本知识
Vue.component('hello', { data: function () { return { count: 0 } }, template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>' })data: function(){ return { count:0 } }//注册组件 Vue.component('blog-post', { props: ['title'], template: '<h3>{{ title }}</h3>' }) //vue实例数据传递数据 <blog-post :title="someTitle"></blog-post>
Last updated