search

Home  >  Q&A  >  body text

javascript - vue2 ajax post data updated, but DOM not responding


1. As shown in the figure: this.AreaData is the array. Every time ajax does the first thing, I clear it first and then assign it. The problem is that the assignment is Successful, but there is no response on the DOM. Why?

ringa_leeringa_lee2803 days ago696

reply all(4)I'll reply

  • 学习ing

    学习ing2017-06-26 10:56:43

    Try putting it into nextTick function

    this.$nextTick(() = {
      this.AreaData = back.commList
    })

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-26 10:56:43

    AreaData, please check if it is declared in the data configuration. If it has been declared, it should be OK.

    reply
    0
  • PHP中文网

    PHP中文网2017-06-26 10:56:43

    I have also encountered it, and I don’t know the reason yet. The solution is to use localstorage to temporarily store it. I think it may be the reason. Please refer to this: vueSet

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-06-26 10:56:43

    Confirm that this points to the vue object

    reply
    0
  • Cancelreply