loading...

watch property async function

ryunishimura profile image Ryu Nishimura ・1 min read
export default {
  watch: {
    async 'user.uid' (val, oldVal) {
      const array = await this.sampleFunc()
      console.log(val, oldVal)
    }
  },
  methods: {
    async sampleFunc() {
      const data = await db.collection('users').doc(`id`).get()
      return data
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Discussion

pic
Editor guide