Merge pull request 'refs #5633 create componente VnAccountNumber' (!118) from 5633-accountNumberComponent into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #118
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Carlos Satorres 2023-12-11 08:36:32 +00:00
commit fbb59b8d61
1 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<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)
);
}
</script>
<template>
<q-input v-model="internalValue" />
</template>