输入框添加首尾去空格js ,修改登录页密码可以点击查看(隐藏)功能
This commit is contained in:
@@ -49,6 +49,8 @@ import '@/assets/less/JAreaLinkage.less'
|
|||||||
import VueAreaLinkage from 'vue-area-linkage'
|
import VueAreaLinkage from 'vue-area-linkage'
|
||||||
import '@/components/jero/JVxeTable/install'
|
import '@/components/jero/JVxeTable/install'
|
||||||
import '@/components/JVxeCells/install'
|
import '@/components/JVxeCells/install'
|
||||||
|
// 输入框去除首尾空格
|
||||||
|
import '@/utils/trim'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.use(Storage, config.storageOptions)
|
Vue.use(Storage, config.storageOptions)
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* 2022-1-25
|
||||||
|
* 输入框去除首尾空格
|
||||||
|
*/
|
||||||
|
|
||||||
|
document.addEventListener('input', (event) => {
|
||||||
|
event.srcElement.value=event.srcElement.value.replace(/(^\s*)|(\s*$)/g, '')
|
||||||
|
})
|
||||||
@@ -25,10 +25,12 @@
|
|||||||
<a-input
|
<a-input
|
||||||
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
|
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
|
||||||
size="large"
|
size="large"
|
||||||
type="password"
|
:type="passwordType"
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
placeholder="请输入密码"
|
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-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -214,7 +216,8 @@
|
|||||||
currdatetime:'',
|
currdatetime:'',
|
||||||
randCodeImage:'',
|
randCodeImage:'',
|
||||||
requestCodeSuccess:false,
|
requestCodeSuccess:false,
|
||||||
rsaPublicKey:''
|
rsaPublicKey:'',
|
||||||
|
passwordType:'password', //passwordType : password , text
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|||||||
Reference in New Issue
Block a user