- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 CKEditor富文本编辑器使用
因为CKEditor 5 舍弃了源码编辑功能,本次使用的是CKEditor 4.17 的版本,4 能满意大多数项目需求。ckeditor4官网地址一、 开始 startnpmnpm install ckeditor4下载访问官方的CKEditor 4下载网站。
2021-11-30 13:38:01
3013
原创 利用高德地图API开发地图选址组件
效果如下html:<div> <el-button type="primary" size="medium" plain @click="handleSelectLocation(true)" v-if="!readonly && !showResult">查询</el-button> <el-button type="primary" size="medium" plain @click="confirmLocation()
2021-07-25 12:39:01
1031
原创 数组常用方法
1.扩展运算符(…)合并数组://ES5 [1,2].concat(more)//ES6 [1,2,...more]2.对象转换成数组Array.form (参数1:对象,参数2:function)3.Array.of ()将一组数值转换成数组4..copyWithin() 将数组内指定位置的成员复制到其他位置,并修改当前数组[1, 2, 3, 4, 5].copyWithin(0,3) //[4, 5, 3, 4, 5]5..find、.findIndex 对数组内部进行条
2021-05-25 17:59:29
134
原创 Echarts自定义legend使用本地图片,自定义坐标轴
legend使用本地图片路径;修改y轴使用不同的图片;先定义一个对象,因为y轴需要用到rich配置项,只能为英文。y轴的data为data:['qt','gy','sf','zz']这样就实现完全自定义啦
2021-03-19 13:43:03
1634
原创 在echarts的tooltip里面再展示一个图表;自定义二echart的legend
tooltip: { backgroundColor: 'rgba(255,255,255,.9)', position: ['40%', '10%'], textStyle:{ color:'#000', }, formatter: function(param){ setTimeout(function(){ that.childRegByChart(param.name,"regChart")},100) var res = param.name .
2021-03-18 09:10:14
853
翻译 实现移动端拖拽
<div class="aui-content aui-margin-b-15" id="conDiv" @mousedown="down" @touchstart="down" @mousemove="move" @touchmove="move" @mouseup="end" @touchend="end"></div> down() { let moveDiv = document.getElementById('box') this.flags = true;
2021-03-10 13:53:09
189
原创 计算占比总和为100整
const calcPercentage = ((data) => { let total = 0 let temp = [] let obj = {} for (let key in data) { let num = !!data[key] ? (data[key].toString().split('.')[1]).substring(0,2) : 0 total += parseInt(data[key]) temp.push({ name: key,
2021-03-10 13:51:21
369
原创 判断数据中某一项对象的值是否存在重复
const ids = this.form.map(value=>value.ZJHM);const idsSet = new Set(ids);if(idsSet.size == ids.length){ console.log('不存在同个值')}else{ console.log('存在同个值') return}
2021-03-10 13:49:13
468
原创 去除富文本的标签和空格
let richText = ' <p style="font-size: 25px;color: white"> sdaflsjf的丰富及饿哦塞尔</p><span>dsfjlie</span>';/* 去除富文本中的html标签 *//* *、+限定符都是贪婪的,因为它们会尽可能多的匹配文字,只有在它们的后面加上一个?就可以实现非贪婪或最小匹配。*/let cont
2021-03-10 13:48:32
1122
原创 es6去重
const res = new Map();data.rows = data.rows.filter((a) => !res.has(a.RESOURCEID) && res.set(a.RESOURCEID, 1))
2021-03-10 13:46:25
84
原创 根据数组中的某个字段排序
response.push({'XZQNAME': '慈溪市', 'LMJ': CXSValue})var desc=function(a,b){return b['LMJ']-a['LMJ']};response.sort(desc)
2021-03-10 13:45:13
361
原创 对关键字进行搜索,并对搜索的字提亮显示
if(this.searchkeyword){ var reg = new RegExp(this.searchkeyword, "g"); var text = "<span style='color:red'>" + this.searchkeyword + "</span>" if (item.title.indexOf(this.searchkeyword) !== '-1') { item.title = item.title.replace(reg, text)
2021-03-10 13:43:02
199
2
翻译 把new Date()格式化年-月-日
自定义方法dateFormat: function(date, format){ var o = { "M+" : date.getMonth()+1, //month "d+" : date.getDate(), //day "h+" : date.getHours(), //hour 24 "H+" : date.getHours(), //hour 24 "m+" : date.getMinutes(), //minute
2021-03-10 13:37:28
1195
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人