After modifying the value of defineModel, I expected emit to pass the latest value of the model to the function of the parent component for use, but found that it was still the old value.
Vue version
3.4
Link to minimal reproduction
Steps to reproduce
见链接里面的代码
What is expected?
期望的到解答defineModel 的值赋值之后不能立刻获取最新的值?
What is actually happening?
const model = defineModel({ type: Boolean })
const version_1_0_0 = (event) => { console.log(model.value,'11111111') model.value = !model.value; //这里的modal.value还是修改前的值 emit('click', model.value, event, '1.0.0'); }
System Info
No response
Any additional comments?
No response