From 75f3a473f2bed1db0b8a8daf4f040a6aa31c3496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Thu, 6 Apr 2023 03:29:48 +0800 Subject: [PATCH] refactor: simplify --- packages/runtime-core/src/apiSetupHelpers.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/runtime-core/src/apiSetupHelpers.ts b/packages/runtime-core/src/apiSetupHelpers.ts index f6d3eb4168d..281b353fafe 100644 --- a/packages/runtime-core/src/apiSetupHelpers.ts +++ b/packages/runtime-core/src/apiSetupHelpers.ts @@ -3,8 +3,7 @@ import { isPromise, isFunction, Prettify, - UnionToIntersection, - isObject + UnionToIntersection } from '@vue/shared' import { getCurrentInstance, @@ -326,7 +325,7 @@ export function useModel(name: string): WritableComputedRef { } const options = (i.propsOptions[0] as NormalizedProps)[name] - if (isObject(options) && !options.required) { + if (options && !options.required) { const proxy = ref(i.props[name]) watch(