How to refresh the page after adding a new page successfully with vue operation?

use the MessageBox component of element-ui as a pop-up window, but how to refresh the page after adding it?

    addUserData(done) {
      this.$ajax.post(this.$api.departmentData, this.form).then(res => {
        if (res.data.status == 200) {
          this.addUser = false;
          this.$message({
            type: "success",
            message: "!"
          });
        }
      });
    },
Mar.15,2021

generally does not refresh the page, and the experience is not good. You can call the API to retrieve the page data after judging that the page is returned successfully


location.reload ()?


generally speaking, my Vue page has a method to obtain data. For example, the method _ fetchData, can obtain data from the server and render List, in the callback function where the new data is successfully added. I will execute _ this._fetchData (), again to automatically refresh the data.


call the parent list interface after success.


write an initialization method to load data, and then call this initialization method


you should just refresh the data. After success, this.query (); will not be finished.

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