强制在同一路由不同的查询参数VueJS上重新加载

时间:2019-11-21 16:07:08

标签: javascript vue.js vue-component vue-router

当用户从编辑页面单击时,我试图重新加载页面组件,路由器不重新加载,并且旧的编辑值仍然保留。

{
  path: "/products/new",
  component: ProductPage,
  meta: {
    breadcrumb: [
      { name: "Home", link: "/home" },
      { name: "Products", link: "/products" },
      { name: "New Product" }
    ]
  }
},
{
  path: "/products/:id",
  component: ProductPage,
  meta: {
    breadcrumb: [
      { name: "Home", link: "/home" },
      { name: "Products", link: "/products" },
      { name: "Edit Product" }
    ]
  }
}

当两个页面具有相同的组件时,有什么方法可以重新加载页面组件吗?

1 个答案:

答案 0 :(得分:0)

使用this.$router.go({path:'/products', params:{id:id}}) ...

import itertools L1 = ["Eagle", "Panther"] L2 = ["Warrior", "Talon", "Machete"] L3 = ["Feather", "Raptor", "Hunter", "Piranha"] for x in itertools.product(L1,L2,L3): print(x)