uniapp使用Vue3版本引入vant

按照官网的方式引入报错 发现是use的时候写错了。。。

import App from './App'
import vant from 'vant'
import 'vant/lib/index.css'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    
    
  ...App
})
app.$mount('#app')
// #endif

// #ifdef VUE3
import {
    
     createSSRApp } from 'vue'
export function createApp() {
    
    
  const app = createSSRApp(App)
	app.use(vant)
  return {
    
    
    app
  }
}

// #endif

猜你喜欢

转载自blog.csdn.net/m0_37408390/article/details/131863148