Files
ClassContent/历届学生/fontendseven/项目练习/上课项目/vuecli2-tpl/src/main.js
2024-09-27 02:06:13 +08:00

23 lines
570 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'amfe-flexible'
import Vue from 'vue'
import App from './App'
import router from './router'
import init from './config/init'
Vue.config.productionTip = false
// 注册全局组件
init.VueComponents.forEach(v => Vue.component(v.name, v))
// 初始化vue插件
init.VuePlugIn.forEach(v => Vue.use(v))
// 挂载非vue插件到vue实例中,这样可以全局调用方法
for (const key in init.NotVuePlugIn) Vue.prototype[key] = init.NotVuePlugIn[key]
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})