输入框添加首尾去空格js ,修改登录页密码可以点击查看(隐藏)功能

This commit is contained in:
bailong
2022-01-25 15:06:49 +08:00
parent 19466f3723
commit abcdb766b2
3 changed files with 15 additions and 2 deletions
+2
View File
@@ -49,6 +49,8 @@ import '@/assets/less/JAreaLinkage.less'
import VueAreaLinkage from 'vue-area-linkage'
import '@/components/jero/JVxeTable/install'
import '@/components/JVxeCells/install'
// 输入框去除首尾空格
import '@/utils/trim'
Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)
+8
View File
@@ -0,0 +1,8 @@
/*
* 2022-1-25
* 输入框去除首尾空格
*/
document.addEventListener('input', (event) => {
event.srcElement.value=event.srcElement.value.replace(/(^\s*)|(\s*$)/g, '')
})
+5 -2
View File
@@ -25,10 +25,12 @@
<a-input
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
size="large"
type="password"
:type="passwordType"
autocomplete="false"
placeholder="请输入密码"
>
<a-icon title="显示密码" @click="passwordType='text'" slot="suffix" v-if="passwordType=='password'" type="eye" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
<a-icon title="隐藏密码" @click="passwordType='password'" slot="suffix" v-else type="eye-invisible" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
<a-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
</a-input>
</a-form-item>
@@ -214,7 +216,8 @@
currdatetime:'',
randCodeImage:'',
requestCodeSuccess:false,
rsaPublicKey:''
rsaPublicKey:'',
passwordType:'password', //passwordType : password , text
}
},
created () {