Skip to content

Commit

Permalink
fix: 和源码中的条件判断不符,且不正确
Browse files Browse the repository at this point in the history
  • Loading branch information
Meglody committed Dec 17, 2021
1 parent c662d97 commit 4fbcee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime-core/componentPublicInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const PublicInstanceProxyHandlers = {
const { setupState, props } = instance;
console.log(`触发 proxy hook , key -> : ${key}`);

if (key !== "$") {
if (key[0] !== "$") {
// 说明不是访问 public api
// 先检测访问的 key 是否存在于 setupState 中, 是的话直接返回
if (hasOwn(setupState, key)) {
Expand Down

0 comments on commit 4fbcee8

Please sign in to comment.