<script setup>中使用生命周期钩子函数写法

 ps:官网看半天没看到。。。

<script setup>
//生命周期钩子函数
onCreated(()=>{
    //var _this = this
    axios.get('http://localhost:8181/book/findAll/1/5').then(function(resp){
        console.log(resp.data)
    })
}) 
//普通方法
const handleClick = (row) => {
  //console.log(row)
  router.push("/update")
}

</script>

猜你喜欢

转载自blog.csdn.net/weixin_46019681/article/details/125324564