两步创建vue全局组件
import Login from './Login'
export default {
install: function(Vue){
Vue.component('Login', Login);
}
}
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import Login from '@/components/common/login' //import store from './store' import store from '@/store' Vue.use(Login) Vue.config.productionTip = false /* eslint-disable no-new */ new Vue({ el: '#app', store, components: { App }, template: '<App/>' })