diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a5356f0626cff0a80cf8a98482eeb4e3df0962..d541a7d72cd5a9211dafb393524548ad942cc525 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 daac64315f47c8ff7289fecb92e43d4819785ce0..4107409274992edf13ad8be9c174f6a103935cdf 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 ? (