Skip to content

Commit d470006

Browse files
committed
refactor: delete complex logic for keep simple
1 parent 6c50d7f commit d470006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-core/src/componentPublicInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hasOwn } from "@mini-vue/shared";
1+
import { hasOwn, EMPTY_OBJ } from "@mini-vue/shared";
22

33
const publicPropertiesMap = {
44
// 当用户调用 instance.proxy.$emit 时就会触发这个函数
@@ -40,7 +40,7 @@ export const PublicInstanceProxyHandlers = {
4040
set({ _: instance }, key, value) {
4141
const { setupState } = instance;
4242

43-
if (setupState !== {} && hasOwn(setupState, key)) {
43+
if (hasOwn(setupState, key)) {
4444
// 有的话 那么就直接赋值
4545
setupState[key] = value;
4646
}

0 commit comments

Comments
 (0)