Beta:发布v2.7.5测试版本 (#1896)
* 生产环境时移除console * 更新第三方库道最新版本,修正导致的兼容问题 * feat: 版本号变更,修复自动化历史的结构体描述 * feat: 放弃element的按需引用,增加自定义表单组件,替换原始的iframe引入模式。 * feat: 放开表单生成器的key输入 * feat: 自动化代码关联属性支持跨数据库关联 * fixed: 修复跨库关联模板 * feat: 允许清空跨数据关联的业务库选项 * feat: 增加用户搜索功能 * feat: 允许单条API同步 --------- Co-authored-by: task <121913992@qq.com> Co-authored-by: task <ms.yangdan@gmail.com>
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import * as path from 'path'
|
||||
export default function fullImportPlugin() {
|
||||
let config
|
||||
return {
|
||||
name: 'fullImportElementPlus',
|
||||
async configResolved(conf) {
|
||||
config = conf
|
||||
},
|
||||
transform(code, id) {
|
||||
const sourcePath = path.join(config.root, 'src/main.js').split(path.sep).join('/')
|
||||
const targetPath = id.split(path.sep).join('/')
|
||||
if (sourcePath === targetPath) {
|
||||
const name = 'ElementPlus'
|
||||
// 引入 ElementPlus 和 样式
|
||||
code = code.replace(/import\s*{\s*createApp\s*}\s*from\s*['"]vue['"]/, ($1) => $1 + `\nimport ${name} from 'element-plus'`)
|
||||
code = code.replace(/import\s*['"]\.\/style\/element_visiable\.scss['"]/, ($1) => $1 + `\nimport 'element-plus/theme-chalk/src/index.scss'`)
|
||||
code = code.replace(/\.mount\(/, ($1) => `.use(${name})` + $1)
|
||||
return code
|
||||
}
|
||||
return code
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user