第一步:创建一个自己的项目
vue init webpack-simple <project-name>
第二部:下载依赖
npm install 或者 cnpm install
第三步:创建自己的组件(页面输出一段话,随便写的)
1、目录结构如下,name与以后引用名称一致
2、index.js中内容
import Loading from './loading.vue'
export default Loading
第四步:base文件夹下index.js写入代码
import Loading from './components/loading'
const components = {
Loading
}
const jeremyui = {
...components
}
const install = function(Vue) {
if (install.installed) return
Object.keys(jeremyui).forEach(key => {
Vue.component(key, jeremyui[key])
})
}
if (typeof window !== 'undefined' && window.Vue) {