Vue中引入组件的步骤?
1.采用ES6的import … from …语法或CommonJS的require()方法引入组件2.对组件进行注册,代码如下注册Vue.component('my-component',{template: '<div>A custom component!</div>'})3.使用组件<my-component></my-com...
·
1.采用ES6的import … from …语法
或
CommonJS的require()方法引入组件
2.对组件进行注册,代码如下
注册
Vue.component('my-component',
{ template: '<div>A custom component!</div>'})
3.使用组件
<my-component></my-component>
更多推荐
所有评论(0)