fix(compat): avoid accidentally delete the modelValue prop (#3772)
This commit is contained in:
parent
92e7330385
commit
4f17be7b1c
@ -39,8 +39,10 @@ export function convertLegacyVModelProps(vnode: VNode) {
|
|||||||
// modelValue -> value
|
// modelValue -> value
|
||||||
// onUpdate:modelValue -> onModelCompat:input
|
// onUpdate:modelValue -> onModelCompat:input
|
||||||
const { prop = 'value', event = 'input' } = (type as any).model || {}
|
const { prop = 'value', event = 'input' } = (type as any).model || {}
|
||||||
|
if (prop !== 'modelValue') {
|
||||||
props[prop] = props.modelValue
|
props[prop] = props.modelValue
|
||||||
delete props.modelValue
|
delete props.modelValue
|
||||||
|
}
|
||||||
// important: update dynamic props
|
// important: update dynamic props
|
||||||
if (dynamicProps) {
|
if (dynamicProps) {
|
||||||
dynamicProps[dynamicProps.indexOf('modelValue')] = prop
|
dynamicProps[dynamicProps.indexOf('modelValue')] = prop
|
||||||
|
Loading…
Reference in New Issue
Block a user