diff --git a/src/router/router-engine.js b/src/router/router-engine.js index 5ac34cf..25c8b07 100644 --- a/src/router/router-engine.js +++ b/src/router/router-engine.js @@ -10,7 +10,7 @@ import { __ROUTER_VIEW__, ROUTE_CALLBACKS } from '../constants.js' //hash前缀正则 const PREFIX_REGEXP = /^(#!|#)[\/]+?/ -const RULE_REGEXP = /(\/[^/]*)(:[A-Za-z0-9_]+)(\?)?/g +const RULE_REGEXP = /(\/[^/]*)(:[\$@~\\!A-Za-z0-9_=\-]+)(\?)?/g const MODE_HASH = 'hash' const MODE_HISTORY = 'history' @@ -70,7 +70,7 @@ class Router { if (_prefix === '/') { _prefix = '/?' } - return _prefix + '([A-Za-z0-9_]+)' + _require + return _prefix + '([\\$\\!@~A-Za-z0-9_=\\-]+)' + _require } )