PASSAGGIO A VITE !

AGG. 1.1.23
This commit is contained in:
Surya Paolo
2025-03-01 14:14:43 +01:00
parent f0098e57b2
commit bc960d38a1
1044 changed files with 5323 additions and 10823777 deletions

View File

@@ -2,7 +2,7 @@ import { defineComponent, onMounted, PropType, ref, watch, computed } from 'vue'
import { tools } from '@src/store/Modules/tools'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { useI18n } from 'vue-i18n'
import { costanti } from '@costanti'
export default defineComponent({
@@ -19,11 +19,11 @@ export default defineComponent({
default: false,
}
},
components: { },
components: {},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const inputValue = ref(props.modelValue);
watch(() => props.modelValue, (newVal) => {
@@ -33,7 +33,7 @@ export default defineComponent({
const displayValue = computed(() => {
return inputValue.value === '' ? '0' : inputValue.value;
});
const handleInput = (value: string | number) => {
if (value === '⌫') {
inputValue.value = inputValue.value.slice(0, -1);
@@ -42,11 +42,11 @@ export default defineComponent({
} else if (typeof value === 'number') {
inputValue.value += value.toString();
}
// Verifica se inputValue contiene più di due cifre decimali
const decimalPattern = /^\d+(\.\d{0,2})?$/; // Regex per validare il numero
const newValue = inputValue.value;
// Se non rispetta il formato, tronca il numero a 2 cifre decimali
if (!decimalPattern.test(newValue)) {
// Se troviamo un punto decimale, manteniamo solo le prime 2 cifre
@@ -59,10 +59,10 @@ export default defineComponent({
inputValue.value = parts[0];
}
}
emit('update:modelValue', inputValue.value);
};
function created() {
// created
}