UI 库替换篇
2026-04-25 更新:脚手架新增
wot-ui-v2选项(@wot-ui/ui),并在交互中前置显示;wot-ui表示v1(wot-design-uni)用于兼容老项目。
◆ 请选择UI库
│ ● wot-ui-v2
│ ○ wot-ui(v1)
│ ○ uview-pro
│ ○ sard-uniapp
│ ○ uv-ui
│ ○ uview-plus
│ ○ 无UI库wot-ui-v2(推荐)
wot-ui-v2 对应官方 Wot UI 2.x 的 npm 包:@wot-ui/ui。
- 创建命令:
pnpm create unibest my-project -u wot-ui-v2 -p h5,mp-weixin- 脚手架会自动处理以下配置:
- 安装
@wot-ui/ui - 在
pages.config.ts注入easycom规则^wd-(.*) - 在
tsconfig.json注入@wot-ui/ui/global - 补充
sass依赖 - 生成与
vite.config.ts同级的wot-ui-resolver.ts - 在
vite.config.ts的UniComponents中注入resolvers: [WotResolver()]
- 安装
官方文档参考:Wot UI 快速上手
温馨提示:
uview-plus跟uv-ui是非常类似的,但是uview-plus需要强制看广告,如果不想看的话,可以选用uv-ui(所以我把uv-ui排在前面)。温馨提示:不同
UI库的使用占比请看 https://unibest-tech.github.io/beacon2/
2026-01-01 数据 wot-ui(62.2%) > uview-pro(10.0%) > uview-plus(7.5%) > sard-uniapp(6.1%) > uv-ui(4.7%) 【另外 none 占比 9.5%】
下面的文档大概率用不到了,仅做参考。
默认 UI 库
unibest 经过几次更迭,先后使用 uni-ui、uv-ui作为默认 UI 库,目前使用 wot-ui 为默认 UI 库。
wot-ui 是 vue3+ts 编写的全端支持的 UI 库,编码体验比 uv-ui 更好;而官方维护的 uni-ui 则样式略丑,组件较少,故弃之。
wot-ui全称wot-design-uni,是wot-design的uniapp版本,文档地址:https://wot-ui.cn/.
很多群友反馈有其他 UI 库的需求,那么更换 UI 库 需要哪些步骤呢?
- 先卸载原有的
wot-ui库 - 再安装其他
UI 库
卸载 wot-ui 库
卸载 wot-ui 过程如下:
- 删除
wot-ui库:
- 删除
pnpm un wot-design-unipages.config.ts文件easycom.custom删除相关配置:
easycom: {
autoscan: true,
custom: {
- '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
},
},tsconfig.json文件compilerOptions.types删除相关配置:
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
- "wot-design-uni/global.d.ts",
"./components.d.ts",
"./global.d.ts"
]安装 uview-pro 库
- 安装
uview-pro库:
- 安装
pnpm add uview-pro- 引入 uView Pro 主库
在项目src 目录中的 main.ts 中,引入并使用 uView Pro 的工具库。
import { createSSRApp } from "vue";
+ import uViewPro from "uview-pro";
export function createApp() {
const app = createSSRApp(App);
+ app.use(uViewPro);
// 其他配置
return {
app,
};
}pages.config.ts文件easycom.custom添加相关配置:
easycom: {
autoscan: true,
custom: {
+ '^u-(.*)': 'uview-pro/components/u-$1/u-$1.vue',
},
},uni.scss中末尾引入uView Pro的颜色变量
@import 'uview-pro/theme.scss';App.vue中首行的位置引入uView Pro的基础样式
<style lang="scss">
@import 'uview-pro/index.scss';
</style>安装 uni-ui 库
- 安装
uni-ui库:
- 安装
pnpm add @dcloudio/uni-uipages.config.ts文件easycom.custom添加相关配置:
easycom: {
autoscan: true,
custom: {
+ '^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
},
},tsconfig.json文件compilerOptions.types添加相关配置:
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
+ "@uni-helper/uni-ui-types",
"./components.d.ts",
"./global.d.ts"
]安装 uv-ui 库
- 安装
uv-ui库:
- 安装
pnpm add @climblee/uv-uipages.config.ts文件easycom.custom添加相关配置:
easycom: {
autoscan: true,
custom: {
+ '^uv-(.*)': '@climblee/uv-ui/components/uv-$1/uv-$1.vue',
},
},tsconfig.json文件compilerOptions.types添加相关配置:
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
+ "@ttou/uv-typings/shim",
+ "@ttou/uv-typings/v2",
"./components.d.ts",
"./global.d.ts"
]安装 uview-plus 库
- 安装
uview-plus库:
- 安装
pnpm add uview-pluspages.config.ts文件easycom.custom添加相关配置:
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',
},
},tsconfig.json文件compilerOptions.types添加相关配置:
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
+ "uview-plus/types",,
"./components.d.ts",
"./global.d.ts"
]uni.scss中末尾引入uview-plus的颜色变量
@import 'uview-plus/theme.scss'; // /* 行为相关颜色 */安装 sard-uniapp 库
- 安装
sard-uniapp库:
- 安装
pnpm add sard-uniapppages.config.ts文件easycom.custom添加相关配置:
easycom: {
autoscan: true,
custom: {
+ '^sar-(.*)': 'sard-uniapp/components/$1/$1.vue',
},
},tsconfig.json文件compilerOptions.types添加相关配置:
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
+ "sard-uniapp/global",
"./components.d.ts",
"./global.d.ts"
]App.vue中首行的位置引入sard-uniapp的基础样式
<style lang="scss">
@import 'sard-uniapp/index.scss';
</style>其他 UI 库的安装类似,不再赘述。
全文完~


