Did vue watch execute before created? What are we going to do?

watch: {

activeTab: {
  handler: function (val, oldVal) {
    if (val === "1") {
      this._getPayBillHouseList()
    } else {
      this._getAppReceiveBillList()
    }
  },
  immediate: true
}

}
created () {

this.hourseId = this.$route.params.id

},
methods: {

async _getPayBillHouseList () {
  let result = await getPayBillHouseList(this.hourseId)
  this.payArr = result.rData
},
async _getAppReceiveBillList () {
  let result = await getAppReceiveBillList(this.hourseId)
  this.overPayArr = result.rData
}

},

Nov.19,2021

perform watch

in created .
this.$watch('activeTab', (val, oldVal) => {
    if (val === '1') {
      this._getPayBillHouseList()
    } else {
      this._getAppReceiveBillList()
    }
  })
The immediate in

watch will let the listener perform the listening calculation when the initial value is declared. If you do not configure the immediate attribute, you can

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b4009f-348a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b4009f-348a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?