<script>
import {ref,reactive,toRefs} from 'vue'
export default{
setup(){
let data=reactive({
mes:0,
userObj:{
userName:'www.96net.com.cn'
},
});
const add=()=>{
data.mes++;
console.log(data.mes)
}
return {
...toRefs(data),
add,
}
}
}
</script>
<template>
<div id="as">
{{userObj.userName}}
</div>
<button @click="add">+</button>
</template>
<style scoped>
</style>