This commit is contained in:
Julien Nahum 2023-12-15 12:32:50 +01:00
parent fa20945571
commit be891b0615
2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,6 @@
"date-fns": "^2.28.0", "date-fns": "^2.28.0",
"debounce": "^1.2.1", "debounce": "^1.2.1",
"fuse.js": "^6.4.6", "fuse.js": "^6.4.6",
"js-cookie": "^2.2.1",
"js-sha256": "^0.9.0", "js-sha256": "^0.9.0",
"libphonenumber-js": "^1.10.44", "libphonenumber-js": "^1.10.44",
"pinia": "^2.1.7", "pinia": "^2.1.7",

View File

@ -33,18 +33,20 @@ export function useFormInput (props, context, formPrefixKey = null) {
}) })
const hasError = computed(() => { const hasError = computed(() => {
return hasValidation && props.form?.errors?.has(name) return hasValidation && props.form?.errors?.has(props.name)
}) })
const compVal = computed({ const compVal = computed({
get: () => { get: () => {
if (props.form) { if (props.form) {
console.log(props, 'props')
return props.form[(formPrefixKey || '') + props.name] return props.form[(formPrefixKey || '') + props.name]
} }
return content.value return content.value
}, },
set: (val) => { set: (val) => {
if (props.form) { if (props.form) {
console.log(props, 'props')
props.form[(formPrefixKey || '') + props.name] = val props.form[(formPrefixKey || '') + props.name] = val
} else { } else {
content.value = val content.value = val