Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果主干中的 URL 不等于我定义的路由,我该如何验证它?
前任。 if (url !== certain route) { // do stuff here }
if (url !== certain route) { // do stuff here }
谢谢
尝试将包罗万象的 splat 设置为路线中的最后一条路线
routes: { ... '*default' : 'default' }
然后
default: function(route) { // do stuff here }
希望这可以帮助