使用Vuetify组件实现简单的输入框密码显示/隐藏切换效果
<v-text-field
  autocomplete="off"
  prepend-inner-icon="mdi-lock"
  placeholder="请输入密码"
  clearable
  rounded="pill"
  hide-details="false"
  variant="solo-filled"
  :type="visible ? 'text' : 'password'"
  :append-inner-icon="visible ? 'mdi-eye-off' : 'mdi-eye'"
  @click:append-inner="visible = !visible"
>
</v-text-field>

<script setup lang="ts">
import { ref, onMounted, shallowRef } from "vue";
const visible = shallowRef(false);
</script>
暂无评论

发送评论 编辑评论


				
上一篇
下一篇