Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Feb 6, 2021
1 parent 8c97910 commit f10dc48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime-core/componentPublicInstance.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const publicPropertiesMap = {
// 当用户调用 instance.proxy.$emit 时就会触发这个函数
// i 就是 instance 的缩写 也就是组件实例对象
$emit: (i) => i.emit,
};

// todo 需要让用户可以直接在 render 函数内直接使用 this 来触发 proxy
export const PublicInstanceProxyHandlers = {
get({ _: instance }, key) {
// 用户访问 proxy[key]
Expand Down

0 comments on commit f10dc48

Please sign in to comment.