V3 新的写法
解决直接修改vue对象冲突问题
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
app.use(/* ... */)
app.config.isCustomElement = tag =>
tag.startsWith('app-')
app.mixin(/* ... */)
app.component(/* ... */)
app.directive(/* ... */)
app.mount('#app')
V2 => V3 api修改对比
全局配置
Vue.config => app.config
config.ignoredElements => config.isCustomElement
删除:~~config.productionTip~~ ~~config.keyCodes~~
全局注册类
Vue.component => app.component
Vue.directive=> app.directive
行为扩展类 API
Vue.minxin => app.mixin
Vue.use=> app.use