Browse Source

浏览器缓存

master
congzc 2 years ago
parent
commit
bd153809fe
3 changed files with 19 additions and 10 deletions
  1. +4
    -1
      src/styles/index.scss
  2. +1
    -1
      src/views/model/editModel.vue
  3. +14
    -8
      vue.config.js

+ 4
- 1
src/styles/index.scss View File

@@ -81,7 +81,7 @@ p {
}


@media screen and (max-width: 280px) {
@media screen and (max-width: 320px) {
/* 根据实际情况修改字体大小和元素宽度 */
html {
// -webkit-text-size-adjust: none !important;
@@ -94,6 +94,9 @@ p {
display: none;
}
}
.listItemBr {
display: none;
}
}
}


+ 1
- 1
src/views/model/editModel.vue View File

@@ -158,7 +158,7 @@
<img src="../../assets/icon/icon-earphone.png" alt="" />
<div>
{{ item.subTitle }}-{{ item.title }}
<br />
<br class="listItemBr" />
{{ item.ageTypeStr }}
</div>
</div>


+ 14
- 8
vue.config.js View File

@@ -1,6 +1,6 @@
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const path = require('path');
let timeStamp = new Date().getTime();

let externals = {}
let cdn = { css: [], js: [] }
@@ -12,8 +12,8 @@ if (isProduction) {
* '包名' : '在项目中引入的名字'
*/
'vue': 'Vue',
'vant': 'vant',
'element-ui': 'ELEMENT',
'xlsx': 'XLSX'
}
cdn = {
css: [
@@ -22,27 +22,33 @@ if (isProduction) {
js: [
// vue must at first!
'https://unpkg.com/vue@2.6.12/dist/vue.js', // vuejs
'https://unpkg.com/vant@2.12/lib/vant.min.js', //vant
'https://unpkg.com/element-ui/lib/index.js', // element-ui js
'https://cdn.jsdelivr.net/npm/xlsx@0.16.6/dist/xlsx.full.min.js' // xlsx
]
}
}

module.exports = {
configureWebpack: {
output: { // 输出重构 打包编译后的js文件名称,添加时间戳.
filename: `js/js[name].${timeStamp}.js`,
chunkFilename: `js/chunk.[id].${timeStamp}.js`,
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
externals,
},
css: {
extract: { // 打包后css文件名称添加时间戳
filename: `css/[name].${timeStamp}.css`,
chunkFilename: `css/chunk.[id].${timeStamp}.css`,
},
css: {
loaderOptions: {
css: {
// options here will be passed to css-loader
},
css: {
},
// postcss: {
// // options here will be passed to postcss-loader
// plugins: [require('postcss-px2rem')({


Loading…
Cancel
Save