This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化旧路由

old
宇天 2019-08-06 16:51:39 +08:00
parent 6d6d706ad0
commit cce4ab3330
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class Router {
Anot.hideProperty(this, 'table', [])
Anot.hideProperty(this, 'last', '')
Anot.hideProperty(this, 'path', '')
Anot.hideProperty(this, 'pathArr', [])
Anot.hideProperty(this, 'ready', false)
Anot.hideProperty(this, 'noMatch', null)
Anot.hideProperty(
@ -178,6 +179,7 @@ class Router {
this.last = this.path
this.path = path
this.pathArr = path.split('/')
LINKS.forEach(vm => {
if (vm.rule.test(this.path)) {
vm.active = true
@ -197,6 +199,7 @@ class Router {
// 跳转到路由
go(path, forceCleanHash = false) {
path = path.replace(/^[/]+/, '')
let { mode, prefix } = this.options
if (mode === 'hash') {