Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.6 只读和浅只读 #221

Open
firstblood93 opened this issue Aug 3, 2024 · 0 comments
Open

5.6 只读和浅只读 #221

firstblood93 opened this issue Aug 3, 2024 · 0 comments

Comments

@firstblood93
Copy link

const obj = shallowReadonly({ foo: { bar: 1 } })

effect(() => {
  console.log(obj.foo.bar)
})

obj.foo.bar = 2 // 浅只读却不触发副作用函数

这里期望的副作用函数应该会执行啊,实际上并没有执行

vue 官网描述,也是可以通过的
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant