-
Hello and forgive me asking this question in the issues. const { value, errorMessage } = useField('name', inputValue => !!inputValue); I am new to vue3 and the libraries of it so I am thinking this |
Beta Was this translation helpful? Give feedback.
Answered by
XEngine
Jan 18, 2022
Replies: 1 comment 4 replies
-
export function useModelBinding(initialValue, emit, opts) {
const {errorMessage, value} = useField(opts.name, opts.rules, {initialValue});
const modelBinding = computed({
get: () => {
return value.value
},
set: (inputValue) => {
value.value = inputValue
emit('update:modelValue', value)
}
})
return {
errorMessage,
modelBinding
}
} used this composable solution for my custom input component. Don't know this is a stable one yet. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
XEngine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
used this composable solution for my custom input component. Don't know this is a stable one yet.