From fbafa3db60c8c9f2d99188f59285ea7c19503903 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 30 Jun 2020 17:50:32 +0800 Subject: [PATCH] first commit --- components/layouts/pc/header.vue | 1 - nuxt.config.js | 21 +++++++++--------- pages/article/_article_id.vue | 37 ++++++++++++++++++-------------- pages/login.vue | 1 + plugins/vditor.js | 4 ++++ store/article.js | 28 ++++++++++++------------ 6 files changed, 50 insertions(+), 42 deletions(-) create mode 100644 plugins/vditor.js diff --git a/components/layouts/pc/header.vue b/components/layouts/pc/header.vue index 41fc334..235167a 100644 --- a/components/layouts/pc/header.vue +++ b/components/layouts/pc/header.vue @@ -144,7 +144,6 @@ let _ts = this; let activeMenu = _ts.$store.state.activeMenu; if (activeMenu !== item) { - this.$store.commit('setActiveMenu', item); if (item === 'topic') { _ts.$router.push( { diff --git a/nuxt.config.js b/nuxt.config.js index 76facdc..b3213e5 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,6 +1,6 @@ import appConfig from './config/app.config' import apiConfig from './config/api.config' -import { isProdMode, isDevMode } from './environment' +import {isProdMode, isDevMode} from './environment' export default { @@ -32,13 +32,13 @@ export default { head: { title: appConfig.meta.title, meta: [ - { charset: 'utf-8' }, - { name: 'viewport', content: 'width=device-width, initial-scale=1' }, - { hid: 'keywords', name: 'keywords', content: appConfig.meta.keywords }, - { hid: 'description', name: 'description', content: appConfig.meta.description } + {charset: 'utf-8'}, + {name: 'viewport', content: 'width=device-width, initial-scale=1'}, + {hid: 'keywords', name: 'keywords', content: appConfig.meta.keywords}, + {hid: 'description', name: 'description', content: appConfig.meta.description} ], link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } + {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'} ] }, /* @@ -52,19 +52,18 @@ export default { ** https://nuxtjs.org/guide/plugins */ plugins: [ - '@/plugins/element-ui', - // '@/plugins/axios' + {src: '@/plugins/element-ui', ssr: true}, + {src: '@/plugins/vditor', ssr: false} ], /* ** Nuxt.js dev-modules */ - buildModules: [ - ], + buildModules: [], /* ** Nuxt.js modules */ modules: [ - ['@nuxtjs/axios', { baseURL: apiConfig.BASE }] + ['@nuxtjs/axios', {baseURL: apiConfig.BASE}] ], /* ** Build configuration diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index 2ae8fa2..9fafa11 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -120,7 +120,7 @@