- 组件 组件的data必须是一个函数,因此每个实例可以维护一份被返回对象的独立的拷贝
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})
参考: * Vue组件
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})
参考: * Vue组件
From here you can search these documents. Enter your search terms below.
Keys | Action |
---|---|
? | Open this help |
n | Next page |
p | Previous page |
s | Search |