feat: 自动导入解析器

This commit is contained in:
2023-07-13 11:00:04 +08:00
parent 58e14e57dd
commit fd8981db73
3 changed files with 71 additions and 11 deletions

View File

@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-06-25 10:56:32
* @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-07-13 10:20:10
* @LastEditTime: 2023-07-13 10:55:59
* @FilePath: \uni\utils\resolver.js
* @Description: 自动导入组件的解析器
*
@ -30,3 +30,24 @@ module.exports.resolverThzxcx = function (name) {
}
}
}
module.exports.resolverThzxcx = function (name) {
if (name.startsWith('Tui')) {
const componentName = toLower(name.slice(3))
return {
name: 'default',
as: name,
from: `thorui-uni/lib/thorui/tui${componentName}/tui${componentName}.vue`,
}
}
}
module.exports.resolverUniUi = function (name) {
if (name.startsWith('Tui')) {
const componentName = toLower(name.slice(3))
return {
name: 'default',
as: name,
from: `@dcloudio/uni-ui/lib/uni${componentName}/uni${componentName}.vue`,
}
}
}