From be3135b1662b1b8f2e289111fb8f058efa81ffb9 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Sun, 28 Jun 2026 14:47:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/patch-u-input.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/patch-u-input.js diff --git a/scripts/patch-u-input.js b/scripts/patch-u-input.js new file mode 100644 index 0000000..ff54a98 --- /dev/null +++ b/scripts/patch-u-input.js @@ -0,0 +1,27 @@ +/** + * uView u-input 组件补丁 + * 直接用预存的补丁文件覆盖原始文件 + * 使下拉选择框(readonly/disabled)超长文字可自动换行完整显示 + * + * 修改内容详见 scripts/u-input.vue(已修改好的完整文件) + * + * 通过 package.json 的 postinstall 自动执行 + */ +const fs = require('fs'); +const path = require('path'); + +const target = path.join('node_modules', 'uview-plus', 'components', 'u-input', 'u-input.vue'); +const source = path.join('scripts', 'u-input.vue'); + +if (!fs.existsSync(target)) { + console.log('[patch-u-input] target not found, skipping'); + process.exit(0); +} + +if (!fs.existsSync(source)) { + console.log('[patch-u-input] source not found, skipping'); + process.exit(0); +} + +fs.copyFileSync(source, target); +console.log('[patch-u-input] Patched successfully');