From 92915a5d804a45ab70be409f79f318cb8848de93 Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Thu, 28 Aug 2025 10:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=A1=86=E7=82=B9=E5=87=BB=E5=88=87=E6=8D=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=AF=86=E7=A0=81=E5=9B=BE=E6=A0=87=E6=97=B6?= =?UTF-8?q?=E6=9C=AA=E5=88=87=E6=8D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ src/editor/text-box/input/input.tsx | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a5356f..d541a7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Fixed + +- 修复密码框点击切换显示隐藏密码图标时未切换的问题 + ## [0.7.41-alpha.10] - 2025-08-27 ### Added diff --git a/src/editor/text-box/input/input.tsx b/src/editor/text-box/input/input.tsx index daac6431..41074092 100644 --- a/src/editor/text-box/input/input.tsx +++ b/src/editor/text-box/input/input.tsx @@ -31,7 +31,7 @@ export const IBizInput = defineComponent({ const showPassword = ref(false); // 是否显示切换明文、暗文密码图标 - let showSwitchIcon = false; + let enableshowpwd = false; // 文本域默认行数,仅在 textarea 类型下有效 const rows = ref(2); @@ -39,8 +39,10 @@ export const IBizInput = defineComponent({ rows.value = 10; } - if (c.editorParams.showswitchicon) { - showSwitchIcon = c.editorParams.showswitchicon === 'true'; + if (c.editorParams.enableshowpwd) { + enableshowpwd = + c.editorParams.enableshowpwd === 'true' || + c.editorParams.enableshowpwd === 'TRUE'; } // 类型 @@ -146,7 +148,7 @@ export const IBizInput = defineComponent({ // 切换明文密码的显示隐藏 const switchPwd = () => { - showPassword.value = !showPassword.value && showSwitchIcon; + showPassword.value = !showPassword.value; }; return { @@ -162,6 +164,7 @@ export const IBizInput = defineComponent({ onClear, inputRef, showPassword, + enableshowpwd, switchPwd, }; }, @@ -184,7 +187,7 @@ export const IBizInput = defineComponent({ return {unitName}; }; } - if (this.type === 'password') { + if (this.type === 'password' && this.enableshowpwd) { slots['right-icon'] = () => { return this.showPassword ? (