安装

兼容性

Uniboot UI 可在支持「最近两个版本」的主流浏览器中运行。

若必须兼容更旧的浏览器,请自行接入 Babel 与 Polyfill。

由于 Vue 3 已不再支持 IE11,Uniboot UI 同样不支持 IE。

versionChrome
Chrome
IE
Edge
Firefox
Firefox
Safari
Safari
< 2.5.0Chrome ≥ 64Edge ≥ 79Firefox ≥ 78Safari ≥ 12
2.5.0 +Chrome ≥ 85Edge ≥ 85Firefox ≥ 79Safari ≥ 14.1

Sass

Uniboot UI 兼容的 Sass 最低版本为 1.79.0

若终端出现 legacy JS API Deprecation Warning,可在 vite.config.ts 中加入如下配置:

vite.config.ts
ts
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
  // ...
  css: {
    preprocessorOptions: {
      scss: { api: 'modern-compiler' },
    },
  },
  // ...
})

版本说明

Uniboot UI 仍在快速迭代中。

使用包管理器

推荐使用包管理器(NPMYarnPNPM)安装 Uniboot UI, 以便配合 ViteWebpack 等打包工具使用。

任选其一即可。

shell
$ npm install uniboot-ui --save
shell
$ yarn add uniboot-ui
shell
$ pnpm install uniboot-ui

配置 npm 源(内网)

安装 uniboot-ui@uniboot/* 依赖前,需能访问团队 Nexus。请将默认 registry 指向聚合源(拉取无 scope 包及公共 transitive 依赖),并将 @uniboot scope 指向发布源;仅配置 @uniboot:registry,无 scope 的 uniboot-ui 仍可能从公网默认源拉取并出现 404

推荐:在项目根目录创建 .npmrc(npm / yarn / pnpm 均会读取):

.npmrc
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/

若通过包管理器安装并配合构建工具使用,请阅读下一节:快速开始