mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-23 02:20:23 +08:00
升级Vue3,iView替换ElementPlus
- 删除babel配置、更新依赖与入口初始化 - 全量替换UI组件、样式适配,新增迁移文档与标签/过滤器自动化替换脚本
This commit is contained in:
26
buyer/scripts/fix-duplicate-size.js
Normal file
26
buyer/scripts/fix-duplicate-size.js
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const ROOT = path.join(__dirname, "..", "src");
|
||||
|
||||
function walk(dir, files = []) {
|
||||
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
const f = path.join(dir, e.name);
|
||||
if (e.isDirectory()) walk(f, files);
|
||||
else if (e.name.endsWith(".vue")) files.push(f);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
let n = 0;
|
||||
for (const file of walk(ROOT)) {
|
||||
let c = fs.readFileSync(file, "utf8");
|
||||
const next = c.replace(/:size="(\d+)"\s+:size="\1"/g, ':size="$1"');
|
||||
if (next !== c) {
|
||||
fs.writeFileSync(file, next);
|
||||
n++;
|
||||
console.log(path.relative(ROOT, file));
|
||||
}
|
||||
}
|
||||
console.log(`Fixed duplicate :size in ${n} files`);
|
||||
Reference in New Issue
Block a user