vue3、vue2 的 main.js 文件区别
vue3、vue2 的 main.js 文件区别vue2:import Vue from 'vue'import App from './App.vue'import Vue from './router'import store from './store'//引入Element-uiimport ElementUI from 'element-ui'Vue.config.productionT
·
vue2:
import Vue from 'vue'
import App from './App.vue'
import Vue from './router'
import store from './store'
//引入Element-ui
import ElementUI from 'element-ui'
Vue.config.productionTip = false;
Vue.use(ElementUI)
Vue.prototype.$http = ()=>{
console.log(xxx)
}
new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#app')
vue3:
import {createApp }from 'vue'
import App from './App.vue'
import Vue from './router'
import store from './store'
import ElementUI from 'element-ui'
const app = createApp(App)
app.config.globalProperties.$http = ()=>{
console.log(xxx)
}
app.use(ElementUI )
app.use(store).use(router).mount('#app')
更多推荐
已为社区贡献2条内容
所有评论(0)