Completes basic functionality for UI configuration
This commit is contained in:
@@ -2,11 +2,17 @@ import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
import Home from './views/Home.vue';
|
||||
import conf from '../public/conf.yml'; // Main site configuration
|
||||
import { pageInfo as defaultPageInfo } from './utils/defaults';
|
||||
import { pageInfo as defaultPageInfo, localStorageKeys } from './utils/defaults';
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
const { sections, pageInfo, appConfig } = conf;
|
||||
let localPageInfo;
|
||||
try {
|
||||
localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]);
|
||||
} catch (e) {
|
||||
localPageInfo = undefined;
|
||||
}
|
||||
|
||||
const router = new Router({
|
||||
routes: [
|
||||
@@ -16,7 +22,7 @@ const router = new Router({
|
||||
component: Home,
|
||||
props: {
|
||||
sections: sections || [],
|
||||
pageInfo: pageInfo || defaultPageInfo,
|
||||
pageInfo: localPageInfo || pageInfo || defaultPageInfo,
|
||||
appConfig: appConfig || {},
|
||||
},
|
||||
meta: {
|
||||
|
||||
Reference in New Issue
Block a user