Vue uses $router to jump to the page and pass the parameter question.

I want to use $router.push () to jump to the page to transfer parameters, how should I write. (ps: my project is all imported into Vue files directly with script tags)

I execute the function Path. I want to transfer the data to the sort-add.html page. How do I write it? The result of this page has always been undefined.

! [picture upload.]


how to pass parameters in the vue-router document is very clear https://router.vuejs.org/zh-c.


multiple pages will not be able to use $router.push.
directly window.location.href='sort-add.html?id=1'


passing parameters between multiple pages has nothing to do with vue. Url is the most common way to pass parameters, which should be talked about when getting started with html.

Menu