refactor(router): dupports multiple mode

This commit is contained in:
qingwei.li 2017-05-29 19:21:08 +08:00 committed by cinwell.li
commit 2c7041c8fb
20 changed files with 377 additions and 220 deletions

View file

@ -1,7 +1,7 @@
import config from '../config'
import { initLifecycle, callHook } from './lifecycle'
import { initRender } from '../render'
import { initRoute } from '../route'
import { initRouter } from '../router'
import { initEvent } from '../event'
import { initFetch } from '../fetch'
import { isFn } from '../util/core'
@ -14,9 +14,9 @@ export function initMixin (proto) {
initLifecycle(vm) // Init hooks
initPlugin(vm) // Install plugins
callHook(vm, 'init')
initRouter(vm) // Add router
initRender(vm) // Render base DOM
initEvent(vm) // Bind events
initRoute(vm) // Add hashchange eventListener
initFetch(vm) // Fetch data
callHook(vm, 'mounted')
}