路由规则增加特殊符号~!@$-=
parent
a24ab67694
commit
ba92054633
|
@ -10,7 +10,7 @@ import { __ROUTER_VIEW__, ROUTE_CALLBACKS } from '../constants.js'
|
||||||
|
|
||||||
//hash前缀正则
|
//hash前缀正则
|
||||||
const PREFIX_REGEXP = /^(#!|#)[\/]+?/
|
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_HASH = 'hash'
|
||||||
const MODE_HISTORY = 'history'
|
const MODE_HISTORY = 'history'
|
||||||
|
@ -70,7 +70,7 @@ class Router {
|
||||||
if (_prefix === '/') {
|
if (_prefix === '/') {
|
||||||
_prefix = '/?'
|
_prefix = '/?'
|
||||||
}
|
}
|
||||||
return _prefix + '([A-Za-z0-9_]+)' + _require
|
return _prefix + '([\\$\\!@~A-Za-z0-9_=\\-]+)' + _require
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue