Vue introduces an object through import, assigns the object to data, and then asynchronously modifies the value of the property of the object in data. Vue cannot listen.

vue introduces an object through import, assigns the object to data, and then asynchronously modifies the value of the property of this object in data. Vue cannot listen

.

this object has the following format:

import { staticObj } from "./a.js"

data() {
  return {
    staticObj: staticObj 
  }
}

async created() {
  const list = await api.getList()
  this.staticObj[0].filters = list  // vuefilters 
}
Oct.28,2021

vue cannot add properties to an object in this way, and the view cannot be updated. The correct results are as follows:

this.$set(this.staticObj[0],'filters',list)

your staticObj is an array. You can use push , splice , Vue.set (vm.items, indexOfItem, newValue)
), please refer to ide/list.html-sharp%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.

.
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-1ea6ba5-1dfd.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-1ea6ba5-1dfd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?