<a-form-item label="密码" name="project_name">
<!-- <a-input v-model:value="editBareMetalForm.password" type="password" autocomplete="new-password" /> -->
<a-input
v-model:value="editBareMetalForm.password"
:type="inputType"
placeholder="请输入密码"
:max-length="64"
autocomplete="new-password"
>
<template #suffix>
<EyeOutlined v-if="inputType=='text'" class="cursor" @click="changeInputType" />
<EyeInvisibleOutlined v-if="inputType == 'password'" class="cursor" @click="changeInputType" />
</template>
</a-input>
</a-form-item>
<script>
import { defineComponent, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons-vue';
export default defineComponent({
components: {
EyeInvisibleOutlined,
EyeOutlined
},
setup(props, { emit }) {
const inputType = ref('password');
function changeInputType() {
if (inputType.value == 'password') {
inputType.value = 'text';
} else {
inputType.value = 'password';
}
}
return {
inputType,
changeInputType
};
}
});
</script>
antdv vue3 防止input 自动填充 password
最新推荐文章于 2023-12-18 10:47:19 发布