版本:
"uview-plus": "^3.1.45"
在page.json中配置:
"easycom": {"autoscan": true,"custom": {"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue","^up-(.*)": "uview-plus/components/u-$1/u-$1.vue","^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"}},
在uni.sass中引入theme.sass
@import "uview-plus/theme.scss";
在main.ts中:
import {createSSRApp} from "vue";
import App from "./App.vue";
// 导入less
import pinia from './stores'
import "uview-plus/index.scss";// @ts-ignore
import uviewPlus from "uview-plus";const app = createSSRApp(App)export function createApp() {app.use(uviewPlus)app.use(pinia)return {app};
}
然后就可以了,这里要注意,theme.sass在unisass中引入的