Subscribe on changes!

expect the ref sugar can support to object destructuring

avatar
Jan 15th 2021

What problem does this feature solve?

expect the ref sugar can support to object destructuring , because via toRef to convert reactive objcet will must to use .value to get value

What does the proposed API look like?

// example ref: { dummy } = props;

const a = reactive([1]) ref: [b] = a; // expect it can be worked console.log(b) // 1

const c = reactive({d : 1}) ref: { d } = a; // expect it can be worked console.log(b) // 1

avatar
Jan 15th 2021

I think you should put it https://github.com/vuejs/rfcs/pull/228, and discuss it there.

avatar
Jan 15th 2021

vuejs/rfcs#228

yep, thankssss