<script setup> const msg = '信息详情' const clickMsg = () =>{ console.log(2223323)} </script> <template> <div>{{ msg }}</div><br> <button @click="clickMsg" >按钮</button> </template> <style scoped> </style>
写了 setup语法糖就不用再 用rerurn 返回
<script setup> const msg = '信息详情' const clickMsg = () =>{ console.log(2223323)} </script> <template> <div>{{ msg }}</div><br> <button @click="clickMsg" >按钮</button> </template> <style scoped> </style>
写了 setup语法糖就不用再 用rerurn 返回