Vue 3 ??? ?? <script setup>
??? ???? ?? ?? ??? ????? ??? ??? ????.
? ??? ???? ? ?? ??? ????? ???? ?? ???? ?? ???? ??? ??? ??? ?? ? ??? ???. ??? ??? ??? ?? ??? ???? ????? ??? ? ????.
?? ?? ?? ??? ? ?? ?? ??? ?? ? ??? ??? ????. ?? Vue 3 ???? ?? ??? ???? ??? ?? ???? ??? ??? ? ????.
??????? ?? ??? ? ??? ?? ref()? ??? ??? ?? ???? ?????.
? ??? ??? ??? ???? Vue ???? ??? ?? ???? ??? ??? ? ???? ????. state.foo ?? state.bar? ???? ?? ??? ?? ?? ??? ? ??? ????
?? ??? ? ??? ? ?? const? ????? ??? ??? ????.<script> import { reactive, toRefs } from 'vue' export default { setup() { const state = reactive({ foo: 1, bar: 2, // the rest of a very large object }) return toRefs(state) } } </script>
???? ??? ??? ???? ???? ???? ???? ??? ?? ?? ?? ??? ? ????.
???foo? bar? ??? ?? ?? ??? ??? ????? ???? ? ????. ??? rest.test
??? ??? ??? ?? ???? ??? ??? ?? ?????? ?????.
?? ??? ??? ?? ?? ?? ??? ?????. ES6?? ???? ??? ??? ??? ???? ??? ??????