当前位置:网站首页>uni-ui安装
uni-ui安装
2022-07-30 23:11:00 【Hel1x】
uni-ui安装
快速开始
在HBuilderX 新建uni-app项目的模板中,选择uni-ui模板即可使用
npm安装
npm install @dcloudio/uni-ui
安装后node_modules文件夹内增加dcloudio文件夹
官方文档
注意 cli 项目默认是不编译 node_modules 下的组件的,导致条件编译等功能失效 ,导致组件异常 需要在根目录创建 vue.config.js 文件 ,增加 @dcloudio/uni-ui 包的编译即可正常
// vue.config.js
module.exports = {
transpileDependencies:['@dcloudio/uni-ui']
}
配置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:[
// ...
]
}
本人配置到这里就能够使用uni-ui组件了
边栏推荐
- MySql统计函数COUNT详解
- 测试人面试 常被问到的计算机网络题,高薪回答模板来了
- PS Basic Learning (1)
- StoneDB 为何敢称业界唯一开源的 MySQL 原生 HTAP 数据库?
- Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言
- 语言代码表
- "NIO Cup" 2022 Nioke Summer Multi-School Training Camp 2 H.Take the Elevator
- Golang go-redis cluster模式下不断创建新连接,效率下降问题解决
- "Wei cup" school more than 2022 cattle summer camp 4 Nancy (polocy) pelosi article variance law of Arts
- #Dasctf July Enabler WP
猜你喜欢
随机推荐
IDEA使用技巧
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
[MySQL] Related operations on databases and tables in MySQL
IJCAI2022 Tutorial | Spoken Language Comprehension: Recent Advances and New Fields
正则表达式语法及使用
ZZULIOJ:1120: 最值交换
MySQL连接时出现2003错误
2sk2225代换3A/1500V中文资料【PDF数据手册】
Compressing Deep Graph Neural Networks via Adversarial Knowledge Distillation
DFS题单以及模板汇总
Go1.18升级功能 - 泛型 从零开始Go语言
测试人面试 常被问到的计算机网络题,高薪回答模板来了
Golang 切片删除指定元素的几种方法
tcp协议传输中的粘包问题
一文详解:SRv6 Policy模型、算路及引流
Go语学习笔记 - gorm使用 - 表增删改查 Web框架Gin(八)
【LeetCode】70. 爬楼梯 - Go 语言题解
VS2017 compile Tars test project
二进制序列
抽象类和接口(学习笔记)









