refs #5633 create componente VnAccountNumber
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-12-04 12:24:39 +01:00
parent cad5d830a0
commit b2b366032f
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<script setup>
import { ref, watch } from 'vue';
import { QInput } from 'quasar';
const props = defineProps({
modelValue: {
type: String,
default: '',
},
});
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
let internalValue = ref(props.modelValue);
watch(
() => props.modelValue,
(newVal) => {
internalValue.value = newVal;
}
);
watch(
() => internalValue.value,
(newVal) => {
emit('update:modelValue', newVal);
accountShortToStandard();
}
);
function accountShortToStandard() {
internalValue.value = internalValue.value.replace(
'.',
'0'.repeat(11 - internalValue.value.length)
);
emit('accountShortToStandard', internalValue.value);
}
</script>
<template>
<q-input v-model="internalValue" />
</template>