Skip to content

Commit

Permalink
refactor: delete complex logic for keep simple
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Sep 2, 2022
1 parent 6c50d7f commit d470006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasOwn } from "@mini-vue/shared";
import { hasOwn, EMPTY_OBJ } from "@mini-vue/shared";

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

if (setupState !== {} && hasOwn(setupState, key)) {
if (hasOwn(setupState, key)) {
// 有的话 那么就直接赋值
setupState[key] = value;
}
Expand Down

0 comments on commit d470006

Please sign in to comment.