From 5f0591da7bc50f428b512ee2cc2068ebda9f402a Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 24 Jan 2021 13:30:39 +0800 Subject: [PATCH] pref: optimize the layout of the post editing page. --- src/config/router.config.js | 22 ++++-- src/core/lazy_lib/components_use.js | 2 + src/layouts/PageView.vue | 31 ++++++++- src/styles/global.less | 4 ++ src/views/dashboard/Dashboard.vue | 2 +- src/views/interface/ThemeList.vue | 1 + src/views/post/CategoryList.vue | 7 +- src/views/post/PostEdit.vue | 64 +++++++++--------- src/views/post/PostList.vue | 8 ++- src/views/post/TagList.vue | 6 +- src/views/sheet/SheetEdit.vue | 75 +++++++++++---------- src/views/sheet/SheetList.vue | 26 +++---- src/views/sheet/independent/JournalList.vue | 7 +- src/views/sheet/independent/LinkList.vue | 8 ++- src/views/sheet/independent/PhotoList.vue | 6 +- 15 files changed, 170 insertions(+), 99 deletions(-) diff --git a/src/config/router.config.js b/src/config/router.config.js index 33c2aeec8..e91c63798 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -21,8 +21,8 @@ export const asyncRouterMap = [ { path: '/posts', name: 'Posts', + component: BlankLayout, redirect: '/posts/list', - component: PageView, meta: { title: '文章', icon: 'form' }, children: [ { @@ -33,10 +33,17 @@ export const asyncRouterMap = [ }, { path: '/posts/write', - name: 'PostEdit', + name: 'PostWrite', component: () => import('@/views/post/PostEdit'), meta: { title: '写文章', hiddenHeaderContent: false, keepAlive: false } }, + { + path: '/posts/edit', + name: 'PostEdit', + hidden: true, + component: () => import('@/views/post/PostEdit'), + meta: { title: '编辑文章', hiddenHeaderContent: false, keepAlive: false } + }, { path: '/categories', name: 'CategoryList', @@ -56,7 +63,7 @@ export const asyncRouterMap = [ { path: '/sheets', name: 'Sheets', - component: PageView, + component: BlankLayout, redirect: '/sheets/list', meta: { title: '页面', icon: 'read' }, children: [ @@ -68,10 +75,17 @@ export const asyncRouterMap = [ }, { path: '/sheets/write', - name: 'SheetEdit', + name: 'SheetWrite', component: () => import('@/views/sheet/SheetEdit'), meta: { title: '新建页面', hiddenHeaderContent: false, keepAlive: false } }, + { + path: '/sheets/edit', + name: 'SheetEdit', + hidden: true, + component: () => import('@/views/sheet/SheetEdit'), + meta: { title: '编辑页面', hiddenHeaderContent: false, keepAlive: false } + }, { path: '/sheets/links', name: 'LinkList', diff --git a/src/core/lazy_lib/components_use.js b/src/core/lazy_lib/components_use.js index ec86dc7df..9394ecef9 100644 --- a/src/core/lazy_lib/components_use.js +++ b/src/core/lazy_lib/components_use.js @@ -1,5 +1,6 @@ import Vue from 'vue' import { + Affix, Anchor, AutoComplete, Alert, @@ -54,6 +55,7 @@ import { Space } from 'ant-design-vue' +Vue.use(Affix) Vue.use(Anchor) Vue.use(AutoComplete) Vue.use(Alert) diff --git a/src/layouts/PageView.vue b/src/layouts/PageView.vue index 78b56708f..2ac2266c3 100644 --- a/src/layouts/PageView.vue +++ b/src/layouts/PageView.vue @@ -1,8 +1,33 @@