uniapp uses Vue3 version to introduce vant

According to the way of the official website, when the error report was introduced, it was found that it was a use error. . .

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

Guess you like

Origin blog.csdn.net/m0_37408390/article/details/131863148