vue2项目升级成vue3 created方法

问题遇到的现象和发生背景

vue2项目升级成vue3

用代码块功能插入代码,请勿粘贴截图

vue2中的代码

  created: function () {
    this.getAllFlowCategoryData()
    this.userId = this.$store.state.user.info.userId
    this.getDoingCount()
    this.getSentCount()
    this.getDoneCount()
    this.getTodoCount()
    this.getAntThisWeekDoneInfo()
  },
我的解答思路和尝试过的方法
const created = () => function (){
  console.log('aaaa')
}

我想要达到的结果

vue3中有什么方法,可以实现created()的效果嘛

https://blog.csdn.net/qq_54357490/article/details/118609637?ops_request_misc=&request_id=&biz_id=102&utm_term=vue2%E9%A1%B9%E7%9B%AE%E5%8D%87%E7%BA%A7%E6%88%90vue3%20created%E6%96%B9%E6%B3%95&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-118609637.nonecase&spm=1018.2226.3001.4187

setup()

img


直接在setup里调用就可以了

需要啥created啊,setup就是了