how use toRef with Map? #7647
Answered
by
rudyxu1102
baixiaoyu2997
asked this question in
Help/Questions
-
const foo=reactive(new Map())
foo.set('a',123)
console.log(toRef(foo,'a').value) // undefined |
Beta Was this translation helpful? Give feedback.
Answered by
rudyxu1102
Feb 6, 2023
Replies: 1 comment 1 reply
-
Maybe you can try Currently, https://github.com/vuejs/core/blob/main/packages/reactivity/src/ref.ts#L252-L261 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
baixiaoyu2997
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe you can try
customRef
. Here is a demo.Currently,
toRef
only works ona plain object
.https://github.com/vuejs/core/blob/main/packages/reactivity/src/ref.ts#L252-L261