-
[综合] js数组根据对象某个字段名去重
removeRepet(list,key){letmap=newMap()list.forEach(item=>{if(!map.has(item[key]))map.set(item[key],item)})return[...map.values()] } this.removeRepet...
13
热度 -
[综合] vue+WebSocket+nodejs模拟
npm安装 npminstallnodejs-websocket--save 添加服务端sock.js letws=require("nodejs-websocket"); console.log("建立链接"); ws.createServer((conn)=>{conn.on("te...
122
热度 -
[综合] VUE+ElementUI 确保只能输入数字
<el-inputplaceholder="数值"v-model.number="value"@input="vNumber"/> methods:{//验证vNumber(val){varnum=/^[0-9]*$/;if(!num.test(val)){//非数字varnewval=...
119
热度 -
[综合] VUE + ElementUI el-date-picker选中日期没反应
情况①: 检查format的格式大小写 情况② 添加代码: @input="$forceUpdate()" 例: <el-date-pickerv-model="value"type="date"value-format="yyyy-MM-dd"@change="getList"@input=...
26
热度 -
[综合] VUE Unexpected console statement
package.json文件,在eslintConfig的rules规则中添加"no-console":"off" "eslintConfig":{..."rules":{"no-console":"off"}, },
97
热度 -
125
热度 -
[综合] VUE + JS设置日期格式
main.js: Date.prototype.Format=function(fmt){varo={"M+":this.getMonth()+1,//月份"d+":this.getDate(),//日"h+":this.getHours(),//小时"m+":this.getMinutes(),/...
115
热度 -
[综合] VUE + Echarts坐标轴刻度虚线+曲线设置
yAxis:{splitLine:{show:true,lineStyle:{type:'dashed'}} }, 折线设置为曲线:smooth:true, series:[{type:"line",smooth:true,...}, 不显示刻度:axisTick;不显示坐标线:axisLine;a...
26
热度 -
[综合] VUE + CSS画三角形
width:0; height:0; border-left:10pxsolidtransparent; border-right:10pxsolidtransparent; border-bottom:10pxsolid#5C77FF;
95
热度 -
106
热度 -
[综合] VUE base64转file
base64ToFile(base64,fileName){letarr=base64.split(',');letmime=arr[0].match(/:(.*?);/)[1];letbytes=atob(arr[1]);letn=bytes.lengthletia=newUint8Array(n...
76
热度 -
[综合] VUE v-for从指定下标开始遍历数据
例:从数组list第二位(下标为1)开始遍历: <divv-for="(i,index)inlist.slice(1,list.length)":key="index"><div>{ {i}}</div> </div>
32
热度 -
[综合] VUE+element UI Table字段判断导致数据错乱问题
添加key值::key="Math.random()" <el-table-columnv-if="age>=18"prop="name"label="名称"align="center":key="Math.random()" />
19
热度 -
[综合] vue 判断数组下各字段是否成立
方式一: letres=list.some((val)=>!val.name) 方式二: letres=list.every(val=>{returnval.check })
68
热度 -
[综合] VUE js平滑滚动到相应位置
lettemp=document.getElementById("id"); temp.scrollIntoView({block:'start',behavior:'smooth'});
10
热度 -
[综合] VUE 报错:this.getOptions is not a function
原因:less版本过高 1.卸载 npmuninstallless-loader 2.安装 npminstallless-loader@5.0.0
103
热度 -
[综合] VUE 查找数组中符合条件的对象
letval=1; letlist=[{id:1,name:'张三'},{id:2,name:'李四'},{id:3,name:'王五'}, ];letarr=list.filter((i)=>{returnval==i.id; });
46
热度 -
[综合] VUE 表格动态滚动导致点击事件失效问题
HTML: <divid="tableBox"><divid="table1"><divv-for="(item,index)inlist":key="index"@click="hanldeClick(item)"><--不重要的row--><...
26
热度 -
36
热度 -
89
热度