扫码关注官方订阅号
var child = {template: '
this is child component
与var child = Vue.extend({template: '
求详细解答
闭关修行中......
区别是,extend 设置的没有id('my-component')
extend
id
// 设 var child = Vue.extend({/*略*/}); Vue.component('my-component',child); // 等价与 Vue.component('my-component',{/*略*/});
// 设 Vue.component('my-component',{/*略*/}); // 则下面两个 child 等价 var child = Vue.extend({/*略*/}); var child = Vue.componet('my-component')
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
区别是,
extend设置的没有id('my-component')