VM5719:9 app.js错误:
TypeError: Vue.filter is not a function
at Object.install (vendor.js? [sm]:9938)
at Object.use (vendor.js? [sm]:4155)
at createApp (app.js? [sm]:32)
at app.js? [sm]:37
at I (WASubContext.js?t=wechat&s=1676013457838&v=2.30.0:1)
at <anonymous>:7:9
at doWhenAllScriptLoaded (<anonymous>:4046:21)
at <anonymous>:15:5
at h.loadBabelModules (assubloader.js:1)(env: Windows,mp,1.06.2301040; lib: 2.30.0)
main.ts
import { createSSRApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import App from './App.vue'
import '@/style/index.css'
import uView from "uview-ui"
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
export function createApp() {
const app = createSSRApp(App).use(uView).use(pinia)
return {
app,
}
}
问题已解决!uview不支持vue3+ts,使用uview-plus;
https://uiadmin.net/uview-plus/components/intro.html