赞
踩
1、安装uni-ui
npm i @dcloudio/uni-ui
2、组件自动引用
配置easycom
使用 npm
安装好 uni-ui
之后,需要配置 easycom
规则,让 npm
安装的组件支持 easycom
打开项目根目录下的 pages.json
并添加 easycom
节点:
- // pages.json
- {
- "easycom": {
- "autoscan": true,
- "custom": {
- // uni-ui 规则如下配置
- "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
- }
- },
-
- // 其他内容
- pages:[
- // ...
- ]
- }
3、配置ts类型
npm i -D @uni-helper/uni-ui-types
tsconfig.json中配置
- "types": [
- "@dcloudio/types",
- "miniprogram-api-typings",
- "@uni-helper/uni-app-types",
- "@uni-helper/uni-ui-types"
- ]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。