- 博客(25)
- 收藏
- 关注
原创 element table组件合并行
表格样式vue表格代码<template> <div class="app-container"> <el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px" > <el-table-column prop="aIndex" label="一级指标" width="" align="
2021-12-25 16:41:35
477
原创 vue中echart乡镇地图报错Error: Invalid geoJson format Cannot read properties of undefined (reading ‘length‘)
vue中echart使用乡镇地图报错Error: Invalid geoJson format Cannot read properties of undefined (reading ‘length’)解决办法按下图文件位置结构在node_modules找到parseGeoJson.js文件在parseGeoJSON.js文件中找到parseGeoJSON函数用下边的同名函数将其替换即可export default function parseGeoJSON(geoJson, nameProper
2021-11-01 13:19:02
1864
3
原创 echart获取省市地图Json
进入网站http://datav.aliyun.com/tools/atlas/index.html#&lat=34.92197103616377&lng=113.5052490234375&zoom=7获取地图json文件
2021-10-29 09:44:21
260
原创 Uncaught Invalid geoJson format TypeError: Cannot read properties of undefined (reading ‘length‘)
乡镇、街道使用echart时报错解决,在echart.js中找到函数parseGeoJSON,用下边的将其替换即可function parseGeoJSON(geoJson, nameProperty) { geoJson = decode(geoJson); return map(filter(geoJson.features, function (featureObj) { // Output of mapshaper may have geometry nul
2021-10-29 09:26:22
2338
原创 echart乡镇地图json echart乡镇、街道地图json获取、制作
1、首先需要下载生成KML文件的工具BigemapGIS DesignerBigemapGIS Designer下载地址进入http://www.bigemap.com/reader/download/页面下载按图下载并安装2、安装完BigemapGIS Designer后,打开导出需要地区的kml文件导出kml文件命名时不要用中文,否则生成json文件时有时会有问题3、使用geojson.io/生成json文件...
2021-10-29 09:20:28
1242
原创 Unterminated template literal:vue拼接字符串包括<script></script>时报错误提示Unterminated template literal
vue拼接字符串包括时报错误提示Unterminated template literalvue拼接字符串包括script标签时报错误提示Unterminated template literal解决方法加反斜杠就可以,在script结束标签里边加反斜杠<\/script>`<a href="${this.formData.url}" target="_balnk" > <img src="${image_url}" id="img" style="width:100
2021-09-10 15:04:54
3644
2
原创 js获取当前月第一天和下个月第一天
let date = new Date() let month = parseInt(date.getMonth() + 1) let year = date.getFullYear() let star_time = '' let end_time = '' let next_month = '' let cur_month = month < 10 ? '0' + month : month star_...
2021-09-08 11:55:41
506
原创 element-ui input限制只能输入数字时,先按非数字键获取v-model失效
<el-form-item label="手机号" > <el-input class="input-w" v-model="form.phone" maxlength="11" oninput="value=value.replace(/[^\d]/g,'')" @blur="form.phone = $event.target.value" placeholder="请填写"></el-input></el-form-item>解决代码 @b
2021-08-18 14:18:44
236
原创 判断数组对象中是否包含另一个数组对象中的元素
判断数组对象中是否包含另一个数组对象中的元素let files = [{url:'xxx.jpg',name:'img1'},{url:'yyy.jpg',name:'img2'}]let imgFileList= [ {url:'xxx.jpg',name:'img1'}]for(let img of files){ const contain= imgFileList.find((item)=>{return item.url === img.url});
2021-07-23 10:00:39
715
原创 根据屏幕中线 fixed 固定定位,滚动条出现时,不会偏移
div{ position: fixed; right: calc(50vw); top: 100px; margin-right: calc(100% - 100vw + 500px); text-align: center; }
2021-04-06 17:17:25
243
原创 流文件下载excel
let baseURL = process.env.VUE_APP_DY_BASE_API var request= new XMLHttpRequest() request.open('GET', `${baseURL}/xxx/aasd/excelProfile?username=${this.formData.username}`, true) request.setRequestHeader('access-token', getToken()) r.
2021-03-16 13:30:51
99
原创 正则匹配以xx开头 以xx结尾
示例地址 http://localhost:8081/newpop/dev-add/7.htmlfullPath -->/newpop/dev-add/7.html(路由)以/eestar/article-topcis/开头,以.html结尾 正斜杠以 \/ 表示const reg = /\/newpop\/dev-add\/(.*)\.html/console.log(reg.test(fullPath)) 匹配成功返回 true 是不返回falsefullPath.mat
2021-03-03 14:18:15
1024
原创 js将二维数组的第二层多个分一组转换成三维数组
//初始数据var data = [ { id: 1, name: '111', list: [ { title: 'xxx', num: 11 }, { title: 'xxx', num: 12 }, { title: 'xxx', num: 13 }, { title: 'xxx', num: 14 }, { title: 'xxx', num: 15 }, { title: 'xxx', num:
2021-02-08 13:04:35
838
原创 vue-router注意事项
1、注意:如果提供了 path,params 会被忽略,上述例子中的 query 并不属于这种情况。取而代之的是下面例子的做法,你需要提供路由的 name 或手写完整的带有参数的 path:(同样的规则也适用于 router-link 组件的 to 属性。)。const userId = '123'router.push({ name: 'user', params: { userId }}) // -> /user/123router.push({ path: `/user/${userId}
2020-12-26 10:26:14
157
原创 vue cli4接入环信webIM
vue cli4接入环信webIM1.安装npm install easemob-websdk --save2.配置文件WebIMConfig.js/** * 环信配置文件 * Filename: webIMConfig.js * Author: * Time: */let appKey = ''if (process.env.NODE_ENV === 'development') { appKey = '111111111111#ceshi'// 测试(放自己的appKe
2020-12-24 15:53:51
380
原创 js判断div下有img标签
<div v-show="false" id="content"></div>后台数据{code: 200, msg: "OK", data: {}}content: "<div class="cc">123</div><div class="cc"><img src="xxx/2020/12/2ba57202012031313062387-940x548.jpg" alt=""></div><div cla
2020-12-03 14:22:42
2770
原创 点击别处不让input光标消失
1、vue中<input id="input"/><div @click.prevent="Fun()"> </div>.prevent阻止默认事件Fun(){ document.getElementById("input").focus(); },2、js中<input id="input"/><div onclick="Fun(event)"> </div>.prevent阻止默认事件
2020-11-13 15:52:15
943
原创 前端面试笔试题1:js写出 25条数据一页 假设14页输出:1~5,6~10,11~14
// 25条数据一页 假设13页输出:1~5,6~10,11~13// n条数据 25条为一页 Math.ceil(n/25)为总页数var n = 260;var arr = [];var p = Math.ceil(n/25);function fun(p){ var num = parseInt(p/5); console.log(p) console.log(num) for(var i=0;i<num;i++){ arr
2020-10-16 16:23:53
224
原创 字符串、单字符数组中字符出现次数
字符串中字符出现次数var str = 'ldsfdljdij 12djfdsbfhbsdf';var obj = {};var key = ''function fun(str){ for(var i = 0;i < str.length; i++){ key = str[i]; if(obj[key]){ obj[key]++; }else{ obj[key] = 1; } } fo
2020-10-15 10:13:06
98
原创 call()、apply() 取数组最大值、最小值
call()、apply() 取数组最大值、最小值var nums = [7,458,121,-6,-215,0] var max1 = Math.max.apply(null,nums); var max2 = Math.max.call(null,5,458,120,-215,0); console.log(max1); // 打印结果458 console.log(max2); // 打印结果458 var min1 = Math.min.apply(null,nums); var
2020-08-15 18:34:15
417
原创 JS取偶数、奇数、质数、合数
JS取偶数、奇数、质数、合数1、取n以内的偶数//取n以内的偶数var arr = [];function even(n){ for(var i=1;i<n;i++){ if(i%2 == 0){//被2整除 arr.push(i) } } return arr;}even(100);//返回[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34
2020-08-14 17:35:13
4115
原创 JS排序-冒泡排序、sort()排序
@[TOCjs排序](这里写自定义目录标题)1、冒泡排序 //冒泡排序方法,将数组重新排序function bSort(arr){ var temp = ''; for(var i=0;i<=arr.length-1;i++){ for(var j=0;j<=arr.length-1-i;j++){ if(arr[j]>arr[j+1]){//判断相邻两个元素,如果前边大于后边执行
2020-08-14 12:04:33
373
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人