From 9bba1fa55e7111769cc6dc3bc5e2f32b4a6c2088 Mon Sep 17 00:00:00 2001 From: pnoker Date: Sun, 26 Jan 2020 20:26:04 +0800 Subject: [PATCH 01/18] . --- src/router/router.js | 87 ++++++++++---------------------------------- 1 file changed, 19 insertions(+), 68 deletions(-) diff --git a/src/router/router.js b/src/router/router.js index b3c5404..5e90a7d 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -1,73 +1,24 @@ -import Vue from 'vue' import VueRouter from 'vue-router' -import Home from '../views/Home.vue' -import Things from '../views/Things.vue' -import Template from '../views/Template.vue' -import Now from '../views/Now.vue' -import History from '../views/History.vue' -import Alarm from '../views/Alarm.vue' -import Label from '../views/Label.vue' -import Picture from '../views/Picture.vue' -import Video from '../views/Video.vue' -import About from '../views/About.vue' +import PageRouter from './page/' +import ViewsRouter from './views/' -Vue.use(VueRouter) +let router = new VueRouter({ + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition + } else { + if (from.meta.keepAlive) { + from.meta.savedPosition = document.body.scrollTop; + } + return { + x: 0, + y: to.meta.savedPosition || 0 + } + } + }, + routes: [] +}); -const routes = [ - { - path: '/', - name: 'home', - component: Home - }, - { - path: '/things', - name: 'things', - component: Things - }, - { - path: '/template', - name: 'template', - component: Template - }, - { - path: '/now', - name: 'now', - component: Now - }, - { - path: '/history', - name: 'history', - component: History - }, - { - path: '/alarm', - name: 'alarm', - component: Alarm - }, - { - path: '/label', - name: 'label', - component: Label - }, - { - path: '/picture', - name: 'picture', - component: Picture - }, - { - path: '/video', - name: 'video', - component: Video - }, - { - path: '/about', - name: 'about', - component: About - } -] - -const router = new VueRouter({ - routes -}) +router.addRoutes([...PageRouter, ...ViewsRouter]); export default router From 91451e9ab7abb2c40d3356bd1585f36601599f14 Mon Sep 17 00:00:00 2001 From: pnoker Date: Sun, 26 Jan 2020 20:41:47 +0800 Subject: [PATCH 02/18] error --- public/img/error/403.svg | 630 ++++++++++++++++++++++++++ public/img/error/404.svg | 773 ++++++++++++++++++++++++++++++++ public/img/error/500.svg | 528 ++++++++++++++++++++++ src/components/error/403.vue | 19 + src/components/error/404.vue | 19 + src/components/error/500.vue | 19 + src/components/error/style.scss | 35 ++ 7 files changed, 2023 insertions(+) create mode 100644 public/img/error/403.svg create mode 100644 public/img/error/404.svg create mode 100644 public/img/error/500.svg create mode 100644 src/components/error/403.vue create mode 100644 src/components/error/404.vue create mode 100644 src/components/error/500.vue create mode 100644 src/components/error/style.scss diff --git a/public/img/error/403.svg b/public/img/error/403.svg new file mode 100644 index 0000000..c1b4fef --- /dev/null +++ b/public/img/error/403.svg @@ -0,0 +1,630 @@ + + + + Group 9 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/img/error/404.svg b/public/img/error/404.svg new file mode 100644 index 0000000..44c25f9 --- /dev/null +++ b/public/img/error/404.svg @@ -0,0 +1,773 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/img/error/500.svg b/public/img/error/500.svg new file mode 100644 index 0000000..c156e21 --- /dev/null +++ b/public/img/error/500.svg @@ -0,0 +1,528 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/error/403.vue b/src/components/error/403.vue new file mode 100644 index 0000000..8d247df --- /dev/null +++ b/src/components/error/403.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/components/error/404.vue b/src/components/error/404.vue new file mode 100644 index 0000000..e91af04 --- /dev/null +++ b/src/components/error/404.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/components/error/500.vue b/src/components/error/500.vue new file mode 100644 index 0000000..6c0ced0 --- /dev/null +++ b/src/components/error/500.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/components/error/style.scss b/src/components/error/style.scss new file mode 100644 index 0000000..36a7ea3 --- /dev/null +++ b/src/components/error/style.scss @@ -0,0 +1,35 @@ +.error { + background: #f0f2f5; + margin-top: -30px; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + + .img { + margin-right: 80px; + height: 360px; + width: 100%; + max-width: 430px; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + } + + .content { + h1 { + color: #434e59; + font-size: 72px; + font-weight: 600; + line-height: 72px; + margin-bottom: 24px; + } + + .desc { + color: rgba(0, 0, 0, 0.45); + font-size: 20px; + line-height: 28px; + margin-bottom: 16px; + } + } +} \ No newline at end of file From 6d254b7bf253f536ad0c57f4392f3f80358fbde3 Mon Sep 17 00:00:00 2001 From: pnoker Date: Sun, 26 Jan 2020 21:20:51 +0800 Subject: [PATCH 03/18] . --- src/components/error/403.vue | 5 +++-- src/components/error/404.vue | 5 +++-- src/components/error/500.vue | 5 +++-- src/components/error/style.scss | 11 ++++++----- src/plugins/element/element-variables.scss | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/error/403.vue b/src/components/error/403.vue index 8d247df..eb40b46 100644 --- a/src/components/error/403.vue +++ b/src/components/error/403.vue @@ -1,13 +1,14 @@