前端开发 常用方法

news/2024/7/10 23:24:25 标签: vue.js, javascript, 前端, html, jquery
字符串替换
"1231231.2".chkItemPath.replaceAll("\.", '#')
// 1231231#2

http://www.niftyadmin.cn/n/1367330.html

相关文章

前端用vue怎么接收并导出文件

window.location.href “excel地址”如果是 get 请求,那直接换成 window.open(url) 就行了创建一个隐藏的 iframe,把 iframe 的 src 指向这个 url,就可以下载了 生明方法 downloadFile module.exports (url ) > {try {const elemIF …

循环请求接口,循环下载word文件

async exportToWord() {let arr this.listif (arr.length > 0) {for (let i 0; i < arr.length; i) {let element arr[i]let url await this.WordAPI(element)if (url) {await this.downflie(url)}}} else {this.$Message.warning({ content: 请至少选择一条 })}},Wo…

vue3 路由跳转携带参数 query 或 params

发 import { useRouter, onBeforeRouteUpdate } from vue-routerrouter.push({name: files,params: {code: 1234}})收 import { useRoute } from "vue-router"; const route useRoute(); const getParams () > {return route.params; }; const getQuery () &…

echarts 饼图 中间定位

直接复制到官网可以查看 echarts官网地址 option {tooltip: {trigger: item,},legend: {top: center,left: 51%,orient: vertical,itemGap: 8,itemWidth: 12,itemHeight: 12,selectedMode: false,itemStyle: {borderCap: butt,borderColor: rgba(121, 121, 121, 1),borderTyp…

最简洁的矩阵图 方块图表 无点击事件 下转事件

复制下面代码直接在官网打开 echarts 官网地址 option {grid: {show: true,left: 0%,top: 0%,width: 100%,height: 100%,borderWidth: 1,},series: [{left: 0%,top: 0%,right: 0%,bottom: 0%,width: 100%,height: 100%,// squareRatio: 0.5,// leafDepth: 1,roam: false,bread…

URL的转码与解码,地址栏参数乱码

使用场景 地址栏获取一个参数&#xff0c;参数是中文的&#xff0c;当我接收这个参数的时候&#xff0c;中文参数乱码了&#xff0c;这时候我们需要用decodeURIComponent 函数解码&#xff1b;encodeURIComponent 和 decodeURIComponent 函数直接用就行。没有方法体&#xff1…

requestAnimationFrame 兼容谷歌 火狐

兼容谷歌 火狐 var requestAnimationFrame (function () {return window.requestAnimationFrame ||window.webkitRequestAnimationFrame ||/* Safari 和 Chrome */window.mozRequestAnimationFrame ||/* Firefox */window.oRequestAnimationFrame ||/* Opera */window.ms…

前端处理运算 向上取整 向下取整 四舍五入 四舍五入(自定义取小数后几位)

向上取整 Math.ceil()向下取整 Math.floor()四舍五入 Math.round() 四舍五入&#xff08;自定义取小数后几位&#xff09; // 计算结果是字符串 (5.6666666).toFixed(4)