From 6459e0eafc24563f565ca2d1c289d4b44c44e5e5 Mon Sep 17 00:00:00 2001 From: Dario Ernst Date: Fri, 21 Jul 2017 00:58:00 +0200 Subject: [PATCH] Add navigation prototype --- client/.eslintrc.js | 60 +++++----- client/src/components/Error404.vue | 58 --------- client/src/components/Index.vue | 173 +++++---------------------- client/src/components/index/foo.vue | 11 ++ client/src/components/index/main.vue | 11 ++ client/src/router.js | 38 +++--- 6 files changed, 107 insertions(+), 244 deletions(-) delete mode 100644 client/src/components/Error404.vue create mode 100644 client/src/components/index/foo.vue create mode 100644 client/src/components/index/main.vue diff --git a/client/.eslintrc.js b/client/.eslintrc.js index bb84162..535da19 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -1,31 +1,33 @@ module.exports = { - root: true, - parserOptions: { - sourceType: 'module' - }, - env: { - browser: true - }, - globals: { - 'cordova': true, - 'DEV': true, - 'PROD': true, - '__THEME': true - }, - // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style - extends: 'standard', - // required to lint *.vue files - plugins: [ - 'html' - ], - // add your custom rules here - 'rules': { - // allow paren-less arrow functions - 'arrow-parens': 0, - 'one-var': 0, - 'import/first': 0, - // allow debugger during development - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }] - } + root: true, + parserOptions: { + sourceType: 'module' + }, + env: { + browser: true + }, + globals: { + 'cordova': true, + 'DEV': true, + 'PROD': true, + '__THEME': true + }, + // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style + extends: 'standard', + // required to lint *.vue files + plugins: [ + 'html' + ], + // add your custom rules here + 'rules': { + // allow paren-less arrow functions + 'arrow-parens': 0, + 'one-var': 0, + 'no-tabs': 0, + 'indent': 0, + 'import/first': 0, + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }] + } } diff --git a/client/src/components/Error404.vue b/client/src/components/Error404.vue deleted file mode 100644 index 4af12d7..0000000 --- a/client/src/components/Error404.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/client/src/components/Index.vue b/client/src/components/Index.vue index 55e9fc9..3ff1f8b 100644 --- a/client/src/components/Index.vue +++ b/client/src/components/Index.vue @@ -1,155 +1,46 @@ + +
- diff --git a/client/src/components/index/foo.vue b/client/src/components/index/foo.vue new file mode 100644 index 0000000..69da599 --- /dev/null +++ b/client/src/components/index/foo.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/client/src/components/index/main.vue b/client/src/components/index/main.vue new file mode 100644 index 0000000..73fabbc --- /dev/null +++ b/client/src/components/index/main.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/client/src/router.js b/client/src/router.js index 4676518..3b98021 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -4,24 +4,30 @@ import VueRouter from 'vue-router' Vue.use(VueRouter) function load (component) { - return () => System.import(`components/${component}.vue`) + return () => System.import(`components/${component}.vue`) } export default new VueRouter({ - /* - * NOTE! VueRouter "history" mode DOESN'T works for Cordova builds, - * it is only to be used only for websites. - * - * If you decide to go with "history" mode, please also open /config/index.js - * and set "build.publicPath" to something other than an empty string. - * Example: '/' instead of current '' - * - * If switching back to default "hash" mode, don't forget to set the - * build publicPath back to '' so Cordova builds work again. - */ + /* + * NOTE! VueRouter "history" mode DOESN'T works for Cordova builds, + * it is only to be used only for websites. + * + * If you decide to go with "history" mode, please also open /config/index.js + * and set "build.publicPath" to something other than an empty string. + * Example: '/' instead of current '' + * + * If switching back to default "hash" mode, don't forget to set the + * build publicPath back to '' so Cordova builds work again. + */ - routes: [ - { path: '/', component: load('Index') }, // Default - { path: '*', component: load('Error404') } // Not found - ] + routes: [ + { + path: '/', + component: load('Index'), + children: [ + { path: '', component: load('index/main') }, + { path: 'foo', component: load('index/foo') } + ] + } +] })