提交 0d40e14f 编写于 作者: U u013235949

Auto Commit

上级 c759c276
...@@ -9,10 +9,11 @@ console.log("欢迎来到 InsCode"); ...@@ -9,10 +9,11 @@ console.log("欢迎来到 InsCode");
// 比如我定义了一个 /about 路由, 可以测试它的匹配情况. // 比如我定义了一个 /about 路由, 可以测试它的匹配情况.
const fn = match("/about", { decode: decodeURIComponent }); const fn = match("/about", { decode: decodeURIComponent });
console.log('fn1', !!fn('/about/')) // 可以匹配 console.log('fn1', !!fn('/about/')) // true
console.log(fn('fn1', !!fn('/about/1')) // false console.log('fn1', !!fn('/about/1')) // false
const fn2 = match("/about/*", { decode: decodeURIComponent }); const fn2 = match("/about/*", { decode: decodeURIComponent });
console.log('fn2', !!fn2('/about/')) // 可以匹配 console.log('fn2', !!fn2('/about')) // false
console.log(fn2('/about/1')) // false console.log('fn2', !!fn2('/about/')) // true
\ No newline at end of file console.log('fn2', !!fn2('/about/1')) // false
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册