From aee2a782053c88b039197090ef187d28a1e4eb55 Mon Sep 17 00:00:00 2001 From: "DESKTOP-6C3NK6N\\WXS" <815034831@qq.com> Date: Wed, 18 Sep 2024 11:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=BF=E6=97=B6=E9=97=B4=E6=9C=AA=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E9=94=81=E5=AE=9A=E5=BC=B9=E6=A1=86=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=95=E7=A4=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main.js b/src/main.js index 01ca175c..e286ef86 100644 --- a/src/main.js +++ b/src/main.js @@ -299,7 +299,8 @@ async function VueInit() { data: { unlock: { my_username: null, - my_password: null + my_password: null, + view: false } }, render: h => h(App) @@ -443,7 +444,8 @@ async function VueInit() { _vm.$message.success(_vm.$t("env:lock:msgBox:lockSuccess")) _vm.unlock = { my_username: null, - my_password: null + my_password: null, + view: false } isOpen = false count = 0; @@ -507,16 +509,21 @@ async function VueInit() { ]), h('el-form-item', { props: { label: _vm.$t("env:lock:msgBox:form:Password") }, + attrs: { + style: "position: relative;" + } }, [ h('input', { props: { value: _vm.unlock.my_password }, + ref: "unlock_my_password_input", attrs: { id: 'my_password', class: 'el-input__inner', - type: 'password', - autocomplete: 'new-password' + type: _vm.unlock.view ? 'text' : 'password', + autocomplete: 'new-password', + style: "padding-right:25px" }, on: { change: (event) => { @@ -526,7 +533,24 @@ async function VueInit() { _vm.unlock.my_password = event.target.value } } - }) + }), + h('i', { + attrs: { + id: 'my_password_view', + class: "el-icon-view", + style: "cursor: pointer;position: absolute;top:35%;right:10px" + }, + on: { + click: (event) => { + _vm.unlock.view = !_vm.unlock.view + if (_vm.unlock.view) { + _vm.$refs['unlock_my_password_input'].type = "text" + } else { + _vm.$refs['unlock_my_password_input'].type = "password" + } + }, + } + }), ]) ]) ])