- First catch the content through a password box, and then hide the password box, as follows:
<input type="password" style="opacity: 0; height: 0px" />
<el-input
v-model="password"
type="password"
show-password
></el-input>
- Use the readonly parameter to make the password box unfillable by default, and then trigger the removeAttribute method through the onfocus event to remove the readonly attribute.
<el-input
v-model="password"
readonly
onfocus="removeAttribute('readonly');"
>
</el-input>