例如 :在components文件夹中以 uni- 开头的组件(规则可以自定)
在pages.json引入
"easycom": {
"autoscan": true, //是否自动扫描组件
"custom": { //自定义扫描规则
"uni-(.*)": "@/components/uni-$1/uni-$1.vue" //在components文件夹中以 uni- 开头的组件
}
}

例如 :在components文件夹中以 uni- 开头的组件(规则可以自定)
在pages.json引入
"easycom": {
"autoscan": true, //是否自动扫描组件
"custom": { //自定义扫描规则
"uni-(.*)": "@/components/uni-$1/uni-$1.vue" //在components文件夹中以 uni- 开头的组件
}
}
本文标题:uni-app使用easycom自动引入组件
本文链接:https://www.haomeiwen.com/subject/pbrzrktx.html
网友评论