feat: init ocsify-server-renderer
This commit is contained in:
parent
f095eb888f
commit
6dea685fee
8 changed files with 124 additions and 7 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { AbstractHistory } from './history/abstract'
|
||||
import { HashHistory } from './history/hash'
|
||||
import { HTML5History } from './history/html5'
|
||||
import { supportsPushState, inBrowser } from '../util/env'
|
||||
import { supportsPushState } from '../util/env'
|
||||
|
||||
export function routerMixin (proto) {
|
||||
proto.route = {}
|
||||
|
|
@ -16,8 +15,6 @@ export function initRouter (vm) {
|
|||
|
||||
if (mode === 'history' && supportsPushState) {
|
||||
router = new HTML5History(config)
|
||||
} else if (!inBrowser || mode === 'abstract') {
|
||||
router = new AbstractHistory(config)
|
||||
} else {
|
||||
router = new HashHistory(config)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,10 @@ export const isIE = UA && /msie|trident/.test(UA)
|
|||
|
||||
export const isMobile = document.body.clientWidth <= 600
|
||||
|
||||
export const inBrowser = typeof window !== 'undefined'
|
||||
|
||||
/**
|
||||
* @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js
|
||||
*/
|
||||
export const supportsPushState = inBrowser && (function () {
|
||||
export const supportsPushState = (function () {
|
||||
// Borrowed wholesale from https://github.com/defunkt/jquery-pjax
|
||||
return window.history &&
|
||||
window.history.pushState &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue