<template>
  <div>
    <h1>Demo</h1>

  </div>
</template>

<script setup>
    import {ref,reactive,toRefs,toRef} from 'vue';

    let arr = reactive([1,2,3,4])
    console.log(arr)
   let [a,b,c,d] = toRefs(arr);
   console.log(a,b,c,d,'你好')
//   let {name1,age} =  {name1:'aa',age:1}
//    let [a,b,c,d] = [1,2,3,4];
//   let {name1,age} =  {name1:'aa',age:1}
let obj =  reactive({name1:'aa',age:1});
const {name1,age} = toRefs(obj);
console.log(name1,age)
let newName = toRef(obj,'name1');
console.log(newName)
</script>

<style lang="scss" scoped>
</style>
