记一次 vue 打包的问题
事件的经过: 一开始采取了 vue 、axaio、vue-router 等不打包在一起的方式,,后来发现总项目并不大,就想把它们都打包在一起算了,,,然后问题出来了 1、连接进项目的 ,mint 的一些组件找不到 import {Toast,Indicator,Loadmore ,Picker} from 'mint-ui'; 在外接 vue 的时候却可以用,,打包在一起的时候就找不到了??? 原因不是很明白(找到答案再更新) 解决: Vue.prototype.$indicator = Indicator; Vue.prototype.$toast = Toast; 2、组件名称只能包含字母数字字符和连字符,并且必须以字母开头。 在外接 vue 的时候却可以用,,打包在一起的时候就报这种错。。见鬼了 [Vue warn]: Invalid component name: "我发布的". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter. Property or method "subStateClick" is not defined on the instance but referenced during render.