2.0.0-rc.2
http://jsfiddle.net/af3cq646/1/
var CUSTOM = Vue.component('custom',{name:'custom'});
console.log(new CUSTOM());
运行小提琴并打开控制台
没有警告,并且没有显示名称为“ custom”的组件
警告“ _ [Vue warn]: options "name" can only be used as a component definition option, not during instance creation
_”并将组件命名为“ VueComponent
”
可以确认这一点,昨天也碰到过这一点。
控制台中的名称在版本2.0.0-rc.3中仍然是“ VueComponent”!
2.0不再使用new Function
来更改构造函数名称(这是为了使整个运行时构建都符合CSP)- name
选项仅影响调试消息和vue-devtools检查。