安装
兼容性
Uniboot UI 可在支持「最近两个版本」的主流浏览器中运行。
若必须兼容更旧的浏览器,请自行接入 Babel 与 Polyfill。
由于 Vue 3 已不再支持 IE11,Uniboot UI 同样不支持 IE。
| version | Chrome | Edge | Firefox | Safari |
|---|---|---|---|---|
| < 2.5.0 | Chrome ≥ 64 | Edge ≥ 79 | Firefox ≥ 78 | Safari ≥ 12 |
| 2.5.0 + | Chrome ≥ 85 | Edge ≥ 85 | Firefox ≥ 79 | Safari ≥ 14.1 |
Sass
Uniboot UI 兼容的 Sass 最低版本为 1.79.0。
若终端出现 legacy JS API Deprecation Warning,可在 vite.config.ts 中加入如下配置:
ts
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
// ...
css: {
preprocessorOptions: {
scss: { api: 'modern-compiler' },
},
},
// ...
})版本说明
Uniboot UI 仍在快速迭代中。
使用包管理器
推荐使用包管理器(NPM、Yarn、PNPM)安装 Uniboot UI, 以便配合 Vite、Webpack 等打包工具使用。
任选其一即可。
shell
$ npm install uniboot-ui --saveshell
$ yarn add uniboot-uishell
$ pnpm install uniboot-ui配置 npm 源(内网)
安装 uniboot-ui 及 @uniboot/* 依赖前,需能访问团队 Nexus。请将默认 registry 指向聚合源(拉取无 scope 包及公共 transitive 依赖),并将 @uniboot scope 指向发布源;仅配置 @uniboot:registry 时,无 scope 的 uniboot-ui 仍可能从公网默认源拉取并出现 404。
推荐:在项目根目录创建 .npmrc(npm / yarn / pnpm 均会读取):
ini
registry=https://nexus.in.whatspos.cn/repository/pax-npm-group/
@uniboot:registry=https://nexus.in.whatspos.cn/repository/pax-npm-release/也可写入用户级配置(仅影响本机,示例为 npm):
shell
npm config set registry https://nexus.in.whatspos.cn/repository/pax-npm-group/
npm config set @uniboot:registry https://nexus.in.whatspos.cn/repository/pax-npm-release/若通过包管理器安装并配合构建工具使用,请阅读下一节:快速开始。