]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compat): avoid accidentally delete the modelValue prop (#3772)
authorHcySunYang <HcySunYang@outlook.com>
Mon, 17 May 2021 18:07:53 +0000 (02:07 +0800)
committerGitHub <noreply@github.com>
Mon, 17 May 2021 18:07:53 +0000 (14:07 -0400)
packages/runtime-core/src/compat/componentVModel.ts

index 03ae787afb9446a2ffee0b4a6491b029c166b660..e179c3b1d41a798bae0e6fa29806f744182704b5 100644 (file)
@@ -39,8 +39,10 @@ export function convertLegacyVModelProps(vnode: VNode) {
     // modelValue -> value
     // onUpdate:modelValue -> onModelCompat:input
     const { prop = 'value', event = 'input' } = (type as any).model || {}
-    props[prop] = props.modelValue
-    delete props.modelValue
+    if (prop !== 'modelValue') {
+      props[prop] = props.modelValue
+      delete props.modelValue
+    }
     // important: update dynamic props
     if (dynamicProps) {
       dynamicProps[dynamicProps.indexOf('modelValue')] = prop