为什么第二种报错,https://developer.mozilla.org... MDN上两种优先级好像一样啊new (Vue.extend({ mixins: [myMixin]
}))// 报错 Uncaught TypeError: Cannot read property 'name' of
// undefined
// at new Vue.extend (vue.js:3425)new Vue.extend({
mixins: [myMixin]
})
1 回答

慕无忌1623718
TA贡献1744条经验 获得超4个赞
仔细比较下这两种区别,便可以解释这个报错
new (Vue.extend({ mixins: [myMixin] }))// 等同于var Content = Vue.extend({ mixins: [myMixin] });new Content;
new Vue.extend({ mixins: [myMixin] })//等同于var Extend = Vue.extend;new Extend({ mixins: [myMixin] });
添加回答
举报
0/150
提交
取消