|
@@ -5,14 +5,17 @@ import { |
|
@@ -5,14 +5,17 @@ import { |
5
|
import {createApp} from './app';
|
5
|
import {createApp} from './app';
|
6
|
import {createApi} from 'create-api';
|
6
|
import {createApi} from 'create-api';
|
7
|
import {Style, Toast, Dialog} from 'cube-ui'; //eslint-disable-line
|
7
|
import {Style, Toast, Dialog} from 'cube-ui'; //eslint-disable-line
|
|
|
8
|
+import {get} from 'lodash';
|
8
|
import Lazy from 'vue-lazyload';
|
9
|
import Lazy from 'vue-lazyload';
|
9
|
import yoho from 'common/yoho';
|
10
|
import yoho from 'common/yoho';
|
10
|
import 'statics/scss/common.scss';
|
11
|
import 'statics/scss/common.scss';
|
11
|
import 'statics/font/iconfont.css';
|
12
|
import 'statics/font/iconfont.css';
|
12
|
import 'statics/font/ufofont.css';
|
13
|
import 'statics/font/ufofont.css';
|
13
|
|
14
|
|
14
|
-const isDegrade = Boolean(!window.__INITIAL_STATE__);
|
|
|
15
|
-const context = window.__INITIAL_STATE__ && window.__INITIAL_STATE__.yoho.context;
|
15
|
+const $app = document.getElementById('app');
|
|
|
16
|
+
|
|
|
17
|
+const isDegrade = Boolean(!($app && $app.attributes['data-server-rendered']));
|
|
|
18
|
+const context = get(window, '__INITIAL_STATE__.yoho.context');
|
16
|
const {app, router, store} = createApp(context);
|
19
|
const {app, router, store} = createApp(context);
|
17
|
|
20
|
|
18
|
if (window.__INITIAL_STATE__) {
|
21
|
if (window.__INITIAL_STATE__) {
|