how to bind v-model:value in render function h()? #3947
-
I'm designing a dialog with NInput, and I want the positiveButton to be disabled when the input value has an empty string filled. current code is like this: const inputRef = ref('');
dialog.info({
content: () =>
h('div', {}, [
`sometext`,
// it's about this line
h(NInput, { modelValue: inputRef }),
]),
positiveText: 'confirm',
positiveButtonProps: {
disabled: inputRef.value.length == 0,
},
negativeText: 'cancel',
onPositiveClick: () => {
// promise handler
},
}); It now performed that the positiveButton never turned enable, guess that the input model not working. I've already tried maybe |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In vue,
|
Beta Was this translation helpful? Give feedback.
In vue,
v-model:value
is the syntactic sugar ofvalue
andon-update:value
. So when you use components throughh
, you can: