当前位置 : 主页 > 手机开发 > ROM >

两步创建vue全局组件

来源:互联网 收集:自由互联 发布时间:2021-06-10
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 a
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/>‘
})
网友评论