一.组件?
1.组件(Component)是Vue.js最强大的功能之一
2.组件可以扩展HTML元素,封装可重用的代码
3.组件是自定义元素
二.使用组件
Vue组件的使用有2个步骤,注册组件,使用组件2个方面
1.注册
要注册一个全局组件,你可以使用 Vue.component(tagName,
options)。例如:
Vue.component('my-component',{
template:'<div>Acustomcomponent!</div>'
})
注