diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 6199f9e883bbcedf80c24246bfc0ae7331ab018d..b68e7e1ce921e4f05b916475015331a29f454d07 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -20,47 +20,47 @@ const env = let externalModules = {} //cdn 配置 let externalConfig = [] -// if (process.env.NODE_ENV === 'production') { -// //生产环境 -// externalModules = { -// vue: 'Vue', -// 'vue-router': 'VueRouter', -// vuex: 'Vuex', -// axios: 'axios', -// 'element-ui': 'element-ui', -// echarts: 'echarts', -// highlight: 'hljs', -// } -// externalConfig = [ -// {js: 'https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js', css: ''}, -// { -// js: 'https://cdn.bootcdn.net/ajax/libs/vue-router/3.0.1/vue-router.min.js', -// css: '', -// }, -// {js: 'https://unpkg.com/axios/dist/axios.min.js', css: ''}, -// {js: 'https://cdn.bootcss.com/vuex/3.6.2/vuex.min.js', css: ''}, -// { -// js: 'https://unpkg.com/element-ui/lib/index.js', -// css: 'https://unpkg.com/element-ui/lib/theme-chalk/index.css', -// }, -// { -// js: 'https://cdn.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.min.js', -// css: '', -// }, -// { -// js: 'https://cdn.bootcdn.net/ajax/libs/highlight.js/11.6.0/highlight.min.js', -// css: '', -// }, -// { -// js: '', -// css: 'https://cdn.bootcdn.net/ajax/libs/github-markdown-css/5.1.0/github-markdown-light.min.css', -// }, -// { -// js: '', -// css: 'https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.css', -// }, -// ] -// } +if (process.env.NODE_ENV === 'production') { + //生产环境 + externalModules = { + vue: 'Vue', + 'vue-router': 'VueRouter', + vuex: 'Vuex', + axios: 'axios', + 'element-ui': 'element-ui', + echarts: 'echarts', + highlight: 'hljs', + } + externalConfig = [ + {js: 'https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js', css: ''}, + { + js: 'https://cdn.bootcdn.net/ajax/libs/vue-router/3.0.1/vue-router.min.js', + css: '', + }, + {js: 'https://unpkg.com/axios/dist/axios.min.js', css: ''}, + {js: 'https://cdn.bootcss.com/vuex/3.6.2/vuex.min.js', css: ''}, + { + js: 'https://unpkg.com/element-ui/lib/index.js', + css: 'https://unpkg.com/element-ui/lib/theme-chalk/index.css', + }, + { + js: 'https://cdn.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.min.js', + css: '', + }, + { + js: 'https://cdn.bootcdn.net/ajax/libs/highlight.js/11.6.0/highlight.min.js', + css: '', + }, + { + js: '', + css: 'https://cdn.bootcdn.net/ajax/libs/github-markdown-css/5.1.0/github-markdown-light.min.css', + }, + { + js: '', + css: 'https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.css', + }, + ] +} const webpackConfig = merge(baseWebpackConfig, { externals: externalModules, //打包忽略 diff --git a/src/components/Article.vue b/src/components/Article.vue index e67dab332369fa5c4158d9afd4f57baf46d7090b..f7a339a4126c53256f855cb3476f8bdb8b5ae21d 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -82,8 +82,9 @@ class="weather_class1" cellpadding="1px" shadow="always" - style="position: static; margin-top: 2%" + style="position: static; margin-top: 2%;text-align: center" > + 爬取天气预报