这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@liuseen-l
Copy link

增加了重复创建ref实例的判断

@viacooter
Copy link

viacooter commented Jan 8, 2023 via email

@liuseen-l
Copy link
Author

liuseen-l commented Jan 8, 2023

// 增加之前
const a = ref(1)
const b = ref(a)
console.log(a === b) // false

// 增加之后
const a = ref(1)
const b = ref(a)
console.log(a === b) // true

加上这个判断对用户学习vue源码,没有增添更多的负担,但却能够更加真实的还原源码当中的细节

@liuseen-l liuseen-l closed this Jan 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants