2.5.9
https://jsfiddle.net/50wL7mdz/82050/#unnecessary-sample-but-required#不必要的必填示例
Vue.component('my:component',{ template:'<br />' });
Don't cause a warn.
不要触发警告。
[Vue warn]: Invalid component name: "my:component". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.
warn @ vue:580
Vue.extend @ vue:4675
Vue.(anonymous function) @ vue:4772
install @ 0:896
Vue.use @ vue:4631
In component context, it will not cause a warn:
在局部组件中,这不会引发警告:
new Vue({
template:'<my:component />',
components:{
'my:component':{ template:'<br />' }
}
});
And, in global context, the namespaced component is usable, although it cause a warn.
另外,在全局组件中,虽然会引发警告,但组件依然可以正常使用。
So I think, this might be a problem from carelessness while engine upgrading, not intentional.
所以我想,这应该是一个引擎升级的疏忽,而非有意为止。
这个限制是有意的,因为 : 通常用来标示 XML 级别的 namespace,在 HTML 的用例中尽量避免。
Most helpful comment
这个限制是有意的,因为
:通常用来标示 XML 级别的 namespace,在 HTML 的用例中尽量避免。