Simulating v-model behavior failed #13348
Unanswered
githublaohu
asked this question in
Help/Questions
Replies: 1 comment
-
If I remember correctly, I believe I’ve already answered your question before. So your code should be modified like this: const data = ref([])
const Comp = () => {
const props = {
// Note: data.value must be accessed inside an effect to collect dependencies.
// Otherwise, updates to data.value won’t trigger reactivity.
data: data.value,
['onUpdate:data']: (e) => {
data.value = e
},
}
return <t-table {...props} />
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Simulating code,
this.$props.data = this.$data.$value.value; this.$props["onUpdate:data"] = $event => this.$data.$value.value = $event; return _createVNode(_resolveComponent("t-table"), this.$props, null);
`
const props = mergeProps({
"data": this.$viewBaseMeta.$data.$value.value,
"onUpdate:data": $event => this.$viewBaseMeta.$data.$value.value = $event
}, this.$props);
`
vue code
return _createVNode(_resolveComponent("t-table"), _mergeProps({ "data": this.$data.$value.value, "onUpdate:data": $event => this..$data.$value.value = $event }, this.$props), null);
Beta Was this translation helpful? Give feedback.
All reactions