From 532efc4caba9d763a335ad9362592ff8b79cc682 Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Mon, 19 Jun 2023 01:05:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=9B=AE=E5=BD=95=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/markdown/DesignMarkdown.vue | 49 ++++++++++---- src/components/markdown/MarkDirTree.vue | 75 ++++++++++++++++++++++ src/main.js | 63 +++++++----------- 3 files changed, 135 insertions(+), 52 deletions(-) create mode 100644 src/components/markdown/MarkDirTree.vue diff --git a/src/components/markdown/DesignMarkdown.vue b/src/components/markdown/DesignMarkdown.vue index fbc284e..414dbfb 100644 --- a/src/components/markdown/DesignMarkdown.vue +++ b/src/components/markdown/DesignMarkdown.vue @@ -1,7 +1,9 @@ diff --git a/src/components/markdown/MarkDirTree.vue b/src/components/markdown/MarkDirTree.vue new file mode 100644 index 0000000..e77af61 --- /dev/null +++ b/src/components/markdown/MarkDirTree.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/main.js b/src/main.js index b7f79b1..ed84864 100644 --- a/src/main.js +++ b/src/main.js @@ -4,7 +4,6 @@ import Vue from 'vue' import axios from 'axios' import hljs from 'highlight.js' -import * as echarts from 'echarts' import importElementComponents from './importElement' import importEchartsComponents from './importEchartsComponents' // 样式cnd @@ -18,31 +17,32 @@ import App from './App' import 'highlight.js/styles/github.css' const env = process.env.NODE_ENV && false + +// 公共的部分 + +Vue.use(cookies) + +Vue.use(hljs) +Vue.directive('highlight', function (el) { + const blocks = el.querySelectorAll('pre code') + blocks.forEach((block) => { + hljs.highlightBlock(block) + }) +}) +// cookie +Vue.prototype.$cookies = cookies +// axios +// Vue.use(axios) +Vue.prototype.$axios = axios +window.$axios_w = axios +Vue.prototype.$cookies.set('user_session', 'null') +// 路由 +const router = useRouter(Vue, VueRouter) // 生产环境 if (env === 'production') { try { - // 路由 - const router = useRouter(Vue, VueRouter) - + // 全局引入 Vue.config.productionTip = false - Vue.use(cookies) - Vue.use(hljs) - Vue.directive('highlight', function (el) { - const blocks = el.querySelectorAll('pre code') - blocks.forEach((block) => { - hljs.highlightBlock(block) - }) - }) - // cookie - Vue.prototype.$cookies = cookies - // axios - // Vue.use(axios) - Vue.prototype.$axios = axios - window.$axios_w = axios - Vue.prototype.$echarts = echarts - window.$echarts_w = echarts - - Vue.prototype.$cookies.set('user_session', 'null') new Vue({ el: '#app', @@ -54,32 +54,13 @@ if (env === 'production') { throw Error(e) } } else { - // 路由 - const router = useRouter(Vue, VueRouter) - // 按需引入elementui importElementComponents(Vue) // 按需引入echarts importEchartsComponents(Vue) - Vue.config.productionTip = false - Vue.use(cookies) - Vue.use(hljs) - Vue.directive('highlight', function (el) { - const blocks = el.querySelectorAll('pre code') - blocks.forEach((block) => { - hljs.highlightBlock(block) - }) - }) - // cookie - Vue.prototype.$cookies = cookies - // axios - // Vue.use(axios) - Vue.prototype.$axios = axios - window.$axios_w = axios - Vue.prototype.$cookies.set('user_session', 'null') new Vue({ el: '#app', router, -- GitLab