Commit b2f6ad32 by 杨明

fixed

1 parent c66f3130
export function debounce(fn, delay, triggerNow) { export function debounce(fn, delay, triggerNow) {
var t = null; var t = null
console.log('ceshi') console.log('ceshi')
var debounced = function(){ var debounced = function() {
var _self = this, var _self = this,
args = arguments; args = arguments
if(t){ if (t) {
clearTimeout(t); clearTimeout(t)
} }
if(triggerNow){ if (triggerNow) {
var exec = !t; var exec = !t
t = setTimeout(function(){
t = null;
}, delay);
if(exec){ t = setTimeout(function() {
// 初次进来 t = null
fn.apply(_self, args); }, delay)
}
}else{ if (exec) {
t = setTimeout(function(){ // 初次进来
fn.apply(_self, args); fn.apply(_self, args)
}, delay);
} }
} else {
t = setTimeout(function() {
fn.apply(_self, args)
}, delay)
}
} }
debounced.remove = function(){ debounced.remove = function() {
clearTimeout(t); clearTimeout(t)
t = null; t = null
} }
return debounced; return debounced
} }
//格式化日期 //格式化日期
export const formatDate = (date, fmt) => { export const formatDate = (date, fmt) => {
  if (!date) { if (!date) {
    date = new Date(); date = new Date()
  } }
  let o = {
    "M+": date.getMonth() + 1, //月份
    "d+": date.getDate(), //日
    "h+": date.getHours(), //小时
    "m+": date.getMinutes(), //分
    "s+": date.getSeconds(), //秒
    "q+": Math.floor((date.getMonth() + 3) / 3), //季度
    S: date.getMilliseconds(), //毫秒  1-3 位  只能一位占位符
    "U+": date.getMilliseconds() //毫秒   可以1-3位占位符
  };
  fmt = fmt || "yyyy-MM-dd hh:mm";
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(
      RegExp.$1,
      (date.getFullYear() + "").substr(4 - RegExp.$1.length)
    );
  for (let k in o)
    if (new RegExp("(" + k + ")").test(fmt))
      fmt = fmt.replace(
        RegExp.$1,
        RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
      );
  return fmt;
};
let o = {
'M+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds(), //毫秒  1-3 位  只能一位占位符
'U+': date.getMilliseconds() //毫秒   可以1-3位占位符
}
fmt = fmt || 'yyyy-MM-dd hh:mm'
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
for (let k in o) if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
return fmt
}
//正则表示式是干什么的? 字符串匹配利器(难,规则多) //正则表示式是干什么的? 字符串匹配利器(难,规则多)
export function formatDate2(date, fmt) { export function formatDate2(date, fmt) {
//1.获取年份 //1.获取年份
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
} }
//2.获取 //2.获取
//M+ ->正则表达式一个规则 //M+ ->正则表达式一个规则
...@@ -79,16 +69,16 @@ export function formatDate2(date, fmt) { ...@@ -79,16 +69,16 @@ export function formatDate2(date, fmt) {
'h+': date.getHours(), 'h+': date.getHours(),
'm+': date.getMinutes(), 'm+': date.getMinutes(),
's+': date.getSeconds() 's+': date.getSeconds()
}; }
for (let k in o) { for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) { if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''; let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str))
} }
} }
return fmt; return fmt
}; }
//填补左边的零(一般返回字符串最后两位) //填补左边的零(一般返回字符串最后两位)
function padLeftZero (str) { function padLeftZero(str) {
return ('00' + str).substr(str.length); return ('00' + str).substr(str.length)
}; }
import { Message } from 'element-ui' import { Message } from 'element-ui'
let util = {} let util = {}
util.cloneText = function (message) { util.cloneText = function(message) {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
document.body.appendChild(input) document.body.appendChild(input)
input.select() input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy') input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input) document.body.removeChild(input)
Message.success('复制成功') Message.success('复制成功')
} }
util.getBeforeDate = function (sign = '-') { util.getBeforeDate = function(sign = '-') {
let day = new Date(); let day = new Date()
let month = day.getMonth() + 1; let month = day.getMonth() + 1
let date = day.getDate(); let date = day.getDate()
if (month < 10) month = '0' + month; if (month < 10) month = '0' + month
if (date < 10) date = '0' + date; if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date; var s = day.getFullYear() + sign + month + sign + date
return s; return s
} }
util.getBeforeMonth = function (days) { util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let year = new Date().getFullYear(); let year = new Date().getFullYear()
let arr = new Array(); let arr = new Array()
for (let i = 0; i < days; i++) { for (let i = 0; i < days; i++) {
if (month <= 0) { if (month <= 0) {
year = year - 1; year = year - 1
month = month + 12; month = month + 12
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
} }
return arr; if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
} }
/** /**
* 格式化时间 * 格式化时间
* @param {Array} time * @param {Array} time
*/ */
util.formatTime = function (time) { util.formatTime = function(time) {
return { return {
startTime: time ? time[0] + ' ' + '00:00:00' : '', startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : '' endTime: time ? time[1] + ' ' + '23:59:59' : ''
} }
} }
util.tringToDate = function (dateStr, separator) { util.tringToDate = function(dateStr, separator) {
if (!separator) { if (!separator) {
separator = "-"; separator = '-'
} }
var dateArr = dateStr.split(separator); var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0]); var year = parseInt(dateArr[0])
var month; var month
//处理月份为04这样的情况 //处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) { if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1)); month = parseInt(dateArr[1].substring(1))
} else { } else {
month = parseInt(dateArr[1]); month = parseInt(dateArr[1])
} }
var day = parseInt(dateArr[2]); var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day); var date = new Date(year, month - 1, day)
return date; return date
} }
util.getDay = function (num, str = '-') { util.getDay = function(num, str = '-') {
var today = new Date(); var today = new Date()
var nowTime = today.getTime(); var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num; var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms)); today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear(); var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString(); var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth; if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString(); var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay; if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay; return oYear + str + oMoth + str + oDay
} }
util.openUrl = function (url) { util.openUrl = function(url) {
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.target = '_blank' link.target = '_blank'
link.rel = 'opener' link.rel = 'opener'
link.click() link.click()
}
util.debounce = function(fn, timer) {
var t = null
return function() {
if (t) {
clearTimeout(t)
}
t = setTimeout(() => {
fn.apply(this, arguments)
}, timer)
}
} }
util.downloadIamge = function (imgsrc, name = new Date().getTime()) { util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名 //下载图片地址和图片名
var image = new Image(); var image = new Image()
// 解决跨域 Canvas 污染问题 // 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous"); image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () { image.onload = function() {
var canvas = document.createElement("canvas"); var canvas = document.createElement('canvas')
canvas.width = image.width; canvas.width = image.width
canvas.height = image.height; canvas.height = image.height
var context = canvas.getContext("2d"); var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height); context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据 var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素 var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件 var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称 a.download = name || 'photo' // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性 a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件 a.dispatchEvent(event) // 触发a的单击事件
}; }
image.src = imgsrc; image.src = imgsrc
} }
export default util
\ No newline at end of file \ No newline at end of file
export default util
...@@ -46,7 +46,17 @@ ...@@ -46,7 +46,17 @@
</div> </div>
<p> <p>
<span>联系电话:</span> <span>联系电话:</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span> <span class="ellipsis-1" v-if="leftPanelInfo.customerPhone">{{ leftPanelInfo.customerPhone }}</span>
<span
class="phone-fill"
v-else
@click="
phoneVisible = true
contactPhone = ''
"
>
待完善
</span>
</p> </p>
<p> <p>
<span>证件号码:</span> <span>证件号码:</span>
...@@ -225,6 +235,12 @@ ...@@ -225,6 +235,12 @@
<el-button type="primary" @click="goBack">返回</el-button> <el-button type="primary" @click="goBack">返回</el-button>
</div> </div>
</div> </div>
<basic-dialog class="phone-fill-box" title="添加联系电话" :isVisible="phoneVisible" @confirmDialog="phoneConfirmDialog" @closeDialog="phoneVisible = false">
<div class="dialog-form">
<label>联系电话:</label>
<el-input v-model.trim="contactPhone" size="small" placeholder="请输入11位的手机号" maxlength="11"></el-input>
</div>
</basic-dialog>
<basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isDestroyClose="true" :btnLoading="sloading" :isShowThirdBtn="true" :isShowCloseBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose"> <basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isDestroyClose="true" :btnLoading="sloading" :isShowThirdBtn="true" :isShowCloseBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot> <slot>
<p class="hint-text color-6"> <p class="hint-text color-6">
...@@ -273,6 +289,7 @@ export default { ...@@ -273,6 +289,7 @@ export default {
}, },
data() { data() {
return { return {
contactPhone: '',
isShowBaseInfo: true, isShowBaseInfo: true,
isShowTooltip: false, isShowTooltip: false,
remark: '', remark: '',
...@@ -551,7 +568,7 @@ export default { ...@@ -551,7 +568,7 @@ export default {
//弹窗数据 //弹窗数据
tagsDialogTitle: '设置标签', tagsDialogTitle: '设置标签',
tagsVisible: false, tagsVisible: false,
phoneVisible: false,
companyTagsList: [], companyTagsList: [],
ownShopTagsList: [], ownShopTagsList: [],
...@@ -776,6 +793,17 @@ export default { ...@@ -776,6 +793,17 @@ export default {
}) })
this.handleClose() this.handleClose()
}, },
phoneConfirmDialog() {
if (!this.contactPhone) {
this.$message.error('请输入联系号码')
return
}
if (!/^1[3456789]\d{9}$/.test(this.contactPhone)) {
this.$message.error('联系号码格式错误')
return
}
this.phoneVisible = false
},
handleConfirm() { handleConfirm() {
this.sloading = true this.sloading = true
let labelIdAddList = [] // 新增的标签 let labelIdAddList = [] // 新增的标签
...@@ -877,6 +905,22 @@ export default { ...@@ -877,6 +905,22 @@ export default {
.pure-yello-text { .pure-yello-text {
color: #fb8f28; color: #fb8f28;
} }
.phone-fill {
font-size: 14px;
font-weight: 400;
color: #5850ff !important;
line-height: 20px;
text-decoration: underline;
cursor: pointer;
}
.dialog-form {
display: flex;
align-items: center;
padding: 30px;
label {
width: 100px;
}
}
.newStyle { .newStyle {
display: flex; display: flex;
font-size: 14px; font-size: 14px;
......
...@@ -656,7 +656,7 @@ export default { ...@@ -656,7 +656,7 @@ export default {
} }
}, },
destroyed() { destroyed() {
window.removeEventListener('scroll', this.initHeight) window.removeEventListener('scroll', this.initHeight, true)
} }
} }
</script> </script>
...@@ -895,7 +895,7 @@ export default { ...@@ -895,7 +895,7 @@ export default {
width: 100%; width: 100%;
background: #ffffff; background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index:999; z-index: 999;
.el-button:nth-child(2) { .el-button:nth-child(2) {
margin-left: 20px; margin-left: 20px;
} }
......
<template>
<div class="content-wrap">
<div class="tree-input">
<el-input placeholder="请输入标签组或标签关键字" v-model="filterText" size="small"><i slot="suffix" class="el-input__icon el-icon-search"></i></el-input>
<span @click="resetTree">重置</span>
</div>
<el-tree @check="checkChange" class="tag-tree" ref="tagTree" :data="labelTree" :props="defaultProps" show-checkbox node-key="id" default-expand-all :expand-on-click-node="false" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<span class="tree-node">{{ node.label }}</span>
<span v-if="data.labelType" @click="editTree(data)">
<i class="el-icon-edit-outline"></i>
</span>
</div>
</el-tree>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/tagsManage'
export default {
name: 'tagGroup',
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
filterText: '',
selectNum: 0,
searchStatus: false,
labelTree: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tagTree.filter(val)
}
},
methods: {
resetTree() {
this.$refs.tagTree.setCheckedKeys([])
this.$emit('getCheckItem', this.$refs.tagTree)
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
//勾选
checkChange() {
this.$emit('getCheckItem', this.$refs.tagTree)
},
getTreeNode(item) {
let tree_id = []
item.forEach(group_item => {
group_item.children.forEach(label_item => {
label_item && tree_id.push(label_item.id)
})
})
this.$refs.tagTree.setCheckedKeys(tree_id)
},
editTree(data) {
this.$emit('editTag', 'edit', data.labelDTO)
},
getTableList() {
let params = {
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.filterText,
edition: this.$globalState.session.merchantModel
}
}
getTableList(params).then(res => {
const labelTreeRets = res.labelTreeRets.map(item => {
return {
id: item.labelGroup.id,
name: item.labelGroup.name,
children: item.labelList,
labelType: item.labelType,
labelDTO: item
}
})
labelTreeRets.forEach(item => {
const index = this.labelTree.findIndex(ret => ret.name == item.labelType)
if (index == -1) {
this.labelTree.push({
id: item.id + '000',
name: item.labelType,
children: [item]
})
} else {
this.labelTree[index].children.push(item)
}
})
// console.log(this.labelTree)
})
}
},
mounted() {
this.getTableList()
}
}
</script>
<style lang="scss" scoped>
.content-wrap {
padding: 16px;
box-sizing: border-box;
height: 100%;
.tree-input {
display: flex;
align-items: center;
span {
display: inline-block;
color: #5850ff;
font-size: 14px;
width: 40px;
margin-left: 6px;
cursor: pointer;
}
}
.tag-tree {
margin-top: 20px;
height: calc(100% - 100px);
overflow-y: auto;
/deep/ {
.el-tree-node {
.el-tree-node__content {
height: 30px;
> .el-checkbox {
display: none;
}
}
}
.el-tree-node__children {
.el-tree-node__content {
.el-checkbox {
display: block;
}
}
}
.custom-tree-node {
font-size: 14px;
color: #333;
}
.tree-node {
width: 140px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.el-tree-node__expand-icon {
font-size: 15px;
margin-top: -2px;
color: #000000;
}
.el-tree-node__expand-icon.is-leaf {
color: transparent;
}
.el-checkbox__inner {
margin-right: 10px;
}
.el-icon-edit-outline {
color: #5850ff;
font-size: 15px;
cursor: pointer;
}
}
}
}
</style>
...@@ -8,99 +8,92 @@ const baseUrl = '/' ...@@ -8,99 +8,92 @@ const baseUrl = '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [ css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css` js: [
], `${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`,
js: [ `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`,
`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, // `${CDN_DOMAIN}ajax/libs/axios/0.21.0/axios.min.js`,
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
// `${CDN_DOMAIN}ajax/libs/axios/0.21.0/axios.min.js`, ]
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `../dist/${packageName}`,
publicPath,//node_env ? baseUrl : '/' publicPath, //node_env ? baseUrl : '/'
assetsDir: 'static', assetsDir: 'static',
configureWebpack: { configureWebpack: {
resolve: { resolve: {
alias: { alias: {
'@': resolve('src'), '@': resolve('src'),
assets: resolve('src/assets'), assets: resolve('src/assets'),
views: resolve('src/views'), views: resolve('src/views'),
components: resolve('src/components'), components: resolve('src/components')
// 'jquery': 'jquery' // 'jquery': 'jquery'
} }
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery', // 创建 '$'、'jQuery'、'window.jQuery' 三个变量指向依赖jquery
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
],
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
'vue': 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'echarts': 'echarts'
}
}, },
plugins: [
new webpack.ProvidePlugin({
devServer: { $: 'jquery', // 创建 '$'、'jQuery'、'window.jQuery' 三个变量指向依赖jquery
hot: true, jQuery: 'jquery',
disableHostCheck: true, 'window.jQuery': 'jquery'
host: process.env.VUE_APP_HOST, })
port: process.env.VUE_APP_PORT, ],
headers: { output: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头 library: `${packageName}-[name]`,
}, libraryTarget: 'umd', // 把微应用打包成 umd 库格式
// proxy: {     jsonpFunction: `webpackJsonp_${packageName}`
// '/api': {        
// target: 'http://rop-merchant.test.glsx.com.cn',
//         
// changeOrigin: true,
//         
// pathRewrite: {            
// '^/api': '/'        
// }    
// },
// },
}, },
chainWebpack: config => { externals: {
config.plugin('html') vue: 'Vue',
.tap(args => { 'element-ui': 'ELEMENT',
// args[0].minify.removeComments = false; 'vue-router': 'VueRouter',
args[0].cdn = cdn vuex: 'Vuex',
return args axios: 'axios',
}) echarts: 'echarts'
config.plugins.delete('preload') // TODO: need test }
config.plugins.delete('prefetch') // TODO: need test },
config.module
.rule('fonts') devServer: {
.test(/.(ttf|otf|eot|woff|woff2)$/) hot: true,
.use('url-loader') disableHostCheck: true,
.loader('url-loader') host: process.env.VUE_APP_HOST,
.tap(options => { port: process.env.VUE_APP_PORT,
options = { headers: {
// limit: 10000, 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
} }
}
\ No newline at end of file \ No newline at end of file
// proxy: {
// '/api': {
// target: 'http://rop-merchant.test.glsx.com.cn',
//
// changeOrigin: true,
//
// pathRewrite: {
// '^/api': '/'
// }
// },
// },
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!