0
点赞
收藏
分享

微信扫一扫

vue3的setup方法注意事项

Sophia的玲珑阁 2022-02-15 阅读 85

在setup中返回一个方法有两种方式:

方式一:

 setup(props, context) {
      const  handleClick = ()=>{ alert('中国冬奥健儿们加油!') }
      return { handleClick }
    }

方式二:

   setup(props, context) {
      function handleClick() { 
          alert('中国必胜!')
      }
      return { handleClick }
    }
举报

相关推荐

0 条评论