惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
雷峰网
雷峰网
爱范儿
爱范儿
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
F
Fortinet All Blogs
L
LangChain Blog
T
Tailwind CSS Blog

博客园 - 飘扬De黑夜

SqlServer 批量修改某个字段类型 U8数据库表汇总 FastReport 使用JSON作为数据源,手工赋值和导出PDF elementui关于表单校验validator Vue.js 2 使用 extends 扩展 element-ui 组件 FastReport-Barcode/QRCode 控件总是存在白色空白区域 双网卡同时访问内外网 vs项目启动后总是提示ID为XXX的进程当前未运行 Vue2全局管理格式化器和Filter Http请求中 Content-Type 常用格式说明 WPF入门基础之双向数据绑定 WPF入门之设置样式 ElementUI-如何给 el-dropdown 的 command 事件传递多个参数 TortoiseGit使用 管理系统中台示例参照 淘宝源安装npm visual studio 2022 自定义组件和自定义控件和用户控件的区别 SqlServer GoupBy 分组后对于非分组的某个字符串进行拼接 SQL Server 实现类似CountIF的函数
uniapp 以npm模式安装插件的项目,如何让自定义组件支持easyc...
飘扬De黑夜 · 2025-04-28 · via 博客园 - 飘扬De黑夜

1、page.json 中easycom设置

"easycom": {
		"autoscan": true,
		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
		"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
		"^das-(.*)": "@/components/das-ui/das-$1/das-$1.vue"
		// "^das-(.*)": "das-ui/das-$1/das-$1.vue"
		// "custom": {
		// 	"^das-(.*)": "@/components/das-ui/das-$1/das-$1.vue"
		// }
		// "autoscan": true,
		// "custom": {
		// 	// uni-ui 规则如下配置
		// 	"^das-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
			
		// }
	},

  注意上述uview-ui目录和@dcloudio目录都是针对的node_modules

官方指定的easycom目录是src目录下的components目录,另外上述配置要生效需要配置vue.config.js

// vue.config.js
module.exports = {
		transpileDependencies:['@dcloudio/uni-ui','uview-ui','das-ui'],
} 

加入自定义组件das-ui,全部放入src/components/das-ui目录下,组件目录结构如下:

src/components/das-ui/das-input/das-input.vue

 Easycom导入:@代表src根目录

"^das-(.*)": "@/components/das-ui/das-$1/das-$1.vue"