全局组件的创建
Vue.component('组件名称', {
data: function() {
return {}
},
template: '组件模板内容'
})
局部组件的创建
var componentA = {
data: function() {
return {}
},
template: '组件模板内容'
}
var vm = new Vue({
components: {
'组件名称': componentA
}
})
全局组件的创建
Vue.component('组件名称', {
data: function() {
return {}
},
template: '组件模板内容'
})
局部组件的创建
var componentA = {
data: function() {
return {}
},
template: '组件模板内容'
}
var vm = new Vue({
components: {
'组件名称': componentA
}
})