我有这条路线/test/a-vs-b
只有在其中找到-vs-
时,我才试图抓住这条路线。
我尝试了一些正则表达式变体,但似乎没有任何作用
routes.push({
name: 'test',
path: '/test/:page((.*)-vs-(.*))',
component: resolve(__dirname, 'test/b.vue'),
});
有什么想法吗?
答案 0 :(得分:2)
VueRouter使用path-to-regexp
库,就像您尝试的那样apparently doesn't handle defining capturing groups with parenthesis。
我只需删除const Web3Utils = require('web3-utils');
const someString = Web3Utils.utf8ToHex('some string');
周围的括号就能使它起作用。
.*