跳转新页面带参数

118 阅读1分钟
 
     {
       path: '/test/testdetail/:id',
       component: './testtestdetail',
     },
     {

-点击跳转详情到新页面 histroy.push 可以跳转,但是无法跳转到新的页面 a 标签和 window.open 可以 但是要注意的是,要通过window.location获取到 URL的信息,通过模版字符串拼接为一个完整的路径

{
    "ancestorOrigins": {},
    "href": "https://baidu.com/",
    "origin": "https://baidu.com",
    "protocol": "https:",
    "host": 'baidu.com",
    "hostname": "baidu.com",
    "port": "",
    "pathname": "/",
    "search": "",
    "hash": ""
}