【发布时间】:2017-11-23 21:28:40
【问题描述】:
我需要有关路线模式的帮助。我有这样的网址:
http://example.com/product/product-title-51
http://example.com/product/another-product-title-137
http://example.com/product/another-product-45-title-with-number-288-anywhere-178
...
我需要编写一个匹配 slug 的最后一个数字的路径模式。该数字是产品 ID。
const router = new VueRouter({
routes: [{
path: '/product/:product',
component: PageProduct,
name: 'Product'
}]
})
我可以在这种情况下使用什么模式?或者您会为 eShop product slug 提出更好的解决方案?
【问题讨论】:
标签: vue.js vuejs2 vue-router