How to add and edit on a page?

The

list operates on one page, and adds and edits on one page. When you click to edit a row of data in table, you can call to query the data according to ID for echo. But how to transfer the echoed data to the new page? I learned that it is troublesome to pass values through bus and vuex, bus. As soon as vuex refreshes the page data, there is no good experience. Is there any other way?

<el-button type="success" icon="el-icon-edit" size="mini" @click="updateCurrentRow(scope.row)"></el-button>

//  Home
updateCurrentRow(row) {
this.$http
  .get(this.$api.thelabelQueryId + `?id=${row.id}`)
  .then(res => {
    if (res.status == 200) {
      // this.ruleForm, ?
      this.ruleForm = res.data.data
      this.$router.push({ path: "/addtag", query: { id: row.id } });
    }
  })
  .catch(err => {
    console.log(err);
  });
},

// ?

clipboard.png

Nov.15,2021

use localStorage to save it, then edit the page to read


pass the id to the new page by route, and then send the request to echo the data, so that you will still have the data when you refresh it, because the API will be called again.


or use vuex to set a variable to store the data that needs to be edited
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-1ea8c00-1f01.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-1ea8c00-1f01.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?