refactor(core): and markdown compiler

This commit is contained in:
qingwei.li 2017-02-18 14:09:17 +08:00 committed by cinwell.li
commit fe88c154b0
12 changed files with 194 additions and 232 deletions

View file

@ -30,13 +30,19 @@ export function routeMixin (Docsify) {
}
}
let lastRoute = {}
export function initRoute (vm) {
normalize()
vm.route = parse()
lastRoute = vm.route = parse()
on('hashchange', _ => {
normalize()
vm.route = parse()
lastRoute = vm.route = parse()
if (lastRoute.path === vm.route.path) {
// TODO: goto xxx
return
}
vm._fetch()
})
}