소스 검색

fix(compat): fix props check for v-model compat warning (#4056)

Austin Keener 4 년 전
부모
커밋
f3e15f633e
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      packages/runtime-core/src/compat/compatConfig.ts

+ 3 - 2
packages/runtime-core/src/compat/compatConfig.ts

@@ -398,9 +398,10 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
           DeprecationTypes.COMPONENT_V_MODEL
           DeprecationTypes.COMPONENT_V_MODEL
         }: false }\`.`
         }: false }\`.`
       if (
       if (
-        comp.props && isArray(comp.props)
+        comp.props &&
+        (isArray(comp.props)
           ? comp.props.includes('modelValue')
           ? comp.props.includes('modelValue')
-          : hasOwn(comp.props, 'modelValue')
+          : hasOwn(comp.props, 'modelValue'))
       ) {
       ) {
         return (
         return (
           `Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
           `Component delcares "modelValue" prop, which is Vue 3 usage, but ` +