fix: 优化UpdateToken组件:创建时直接显示输入框和防止浏览器自动填充密码

This commit is contained in:
“怀磊”
2021-11-04 17:59:20 +08:00
committed by Jiangjie.Bai
parent 68a08a25dc
commit f000810ccf

View File

@@ -1,7 +1,17 @@
<template>
<div>
<el-button v-show="!isShow" type="text" icon="el-icon-edit" @click="isShow=true">{{ text }}</el-button>
<el-input v-show="isShow" v-model="curValue" :type="type" :placeholder="placeholder" show-password @change="onChange" />
<el-button v-show="!isShow" type="text" icon="el-icon-edit" @click="isShow=true">
{{ text }}
</el-button>
<el-input
v-show="isShow"
v-model.trim="curValue"
show-password
:type="type"
autocomplete="new-password"
:placeholder="placeholder"
@change="onChange"
/>
</div>
</template>
@@ -33,6 +43,11 @@ export default {
curValue: this.value
}
},
created() {
if (this.$route.path.indexOf('/create') !== -1) {
this.isShow = true
}
},
methods: {
onChange(e) {
this.$emit('input', this.curValue)