Vue params value

handleEdit (index, row) {

   // let id = row._id
    this.$router.push({name: "news-edit", params : {
      new : row
    }, query: {id: row._id, type: "edit"}})
  },

Let let id= row._id show id=undefined, but row._id is worth it. I don"t know why

mounted () {

  debugger
  console.log(this.$route.query.type)
  if ( "edit" == this.$route.query.type ){
    let old = this.$route.params.new
    this.title = old.title
    this.author = old.author
    this.content = old.content
    this.abstract = old.abstract
    this.coverImage = old.coverImage
  }
  console.log(this.title)
},

the same problem with old causes the following title not to get anything

Oct.12,2021

The

params parameter is declared in the route. For example, if url / newsedit, is followed by a params parameter called new, it should be declared in the route:

{
    path: '/newsedit/:new',
    component: xxx
}

otherwise, the new value will not be available when your page is refreshed. The
query parameter can be undeclared.

Menu