How does vue modify variables for calculation properties?

computed: {
    nowDate () {
      return utils.formatTime(new Date(), "date")
    }
  },
  methods: {
    bindPickerChange (e) {
      this.nowDate = e.value
    }
  }

the nowdate variable defined in computed does not work to modify nowdate in bindPickerChange?

May.14,2021

the calculation attribute depends on data. Even if you change the calculation attribute, the data does not change, so it does not change


need to write set function

computed: {
    nowDate:{
      get ()  {},
      set (newValue) {}
    }
  },

refer to the official documentation. You need to provide a setter for the computed attribute assignment.
ide/computed.html-sharp%E8%AE%A1%E7%AE%97%E5%B1%9E%E6%80%A7%E7%9A%84-setter" rel=" nofollow noreferrer "> calculate the setter of the attribute


you can try watch to listen to your data value, and then do something

  

have you solved the problem behind the owner of the building?

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