#8448 - devToTest #1254
|
@ -2,11 +2,8 @@
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const model = defineModel({ type: [Number, String] });
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
toggleVisibility: {
|
toggleVisibility: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
@ -14,18 +11,16 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const showPassword = ref(false);
|
const showPassword = ref(false);
|
||||||
const model = defineModel({ type: [Number, String] });
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-bind="{ ...$attrs }"
|
v-bind="{ ...$attrs }"
|
||||||
v-model.number="model"
|
v-model="model"
|
||||||
:type="
|
:type="
|
||||||
$props.toggleVisibility ? (showPassword ? 'text' : 'password') : $attrs.type
|
$props.toggleVisibility ? (showPassword ? 'text' : 'password') : $attrs.type
|
||||||
"
|
"
|
||||||
hint=""
|
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append v-if="toggleVisibility">
|
||||||
<QIcon
|
<QIcon
|
||||||
:name="showPassword ? 'visibility_off' : 'visibility'"
|
:name="showPassword ? 'visibility_off' : 'visibility'"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
Loading…
Reference in New Issue