学习记录
qq_39664116
这个作者很懒,什么都没留下…
展开
-
echarts dataZoom使用
#1. echart横向柱状图滚动条从顶部开始。##1. echart纵向柱状图滚动条从顶部开始。原创 2023-08-02 10:00:52 · 978 阅读 · 0 评论 -
根据特定数组顺序给数据排序
根据特定数组顺序给数据排序原创 2022-06-21 15:48:35 · 34 阅读 · 0 评论 -
npm安装软件遇到verb lock
当npm安装软件遇到:/ extract:vue-qriously: verb lock using C:\Users\Jun\AppData\Roaming\npm-cache_locks\staging-97d0类似的 verb lock解决办法:修改 npm 的安装目录下的 npmrc文件 增加一条 registry=http://registry.cnpmjs.org$ npm config set registry http://registry.cnpmjs.org...原创 2022-01-18 10:14:17 · 4807 阅读 · 0 评论 -
数组循环增加异步请求字段
async componentDidMount() { function test(i) { return new Promise((resolve, reject) => { let sino = parseInt(i * 6 + 1); setTimeout(() => { resolve(sino); }, 3000); }); } const matchInfo = [{ a: 1 }, { a: 2 }, { a: 3 }].原创 2021-06-16 11:39:02 · 92 阅读 · 0 评论 -
数组对象中修改某个节点的值
var tree = [ { name: 'node1' }, { name: 'node2', children: [{ name: 'node-2-1' }, { name: 'node2-2' }] }, { name: 'node3', children: [ { name: 'node-3-1', children: [{ name: 'node3-1-1' }] }, { name: 'node3-2' }, ], }, ]原创 2021-03-17 09:43:30 · 751 阅读 · 0 评论 -
多个if-else 的优化
1: 多元判断时:将condition写作正则存到Map里const actions = ()=>{ const functionA = ()=>{/*do sth*/} const functionB = ()=>{/*do sth*/} const functionC = ()=>{/*send log*/} return new Map([ [/^guest_[1-4]$/,functionA], [/^guest_5$/,functionB]原创 2020-07-17 08:59:28 · 595 阅读 · 0 评论 -
echart-堆叠的柱形图
1:正常的堆叠var option = { tooltip: { trigger: "axis", }, legend: { itemWidth: 10, // 设置宽度 itemHeight: 10, // 设置高度 data:['缺勤','出勤'], x: '4%', y: '5', textStyle: { // 图例的公原创 2020-07-08 16:45:06 · 768 阅读 · 0 评论 -
元素定位区别
1.offsetLeft/offsetTop在页面任一元素的offsetLeft总是找到离其最近的已经定位的父元素或祖先元素定位,如果没有,就根据根节点body定位,然后获取其left值。元素的边框的外边缘距离与已定位的父容器(offsetparent)的左边距离(不包括元素的边框和父容器的边框)2.offset().left/offset().top返回或设置匹配元素相对于文档的偏移(位置)。 无论元素的父元素或祖先元素的position属性是什么,总是计算相对于文档的位置也就是相对于当前文档的原创 2020-06-28 09:44:01 · 180 阅读 · 0 评论 -
cnpm 安装
1、配置npm config set prefix “d:\nodejs\node_global”npm config set cache “d:\nodejs\node_cache”2、cnpm 安装1:npm install -g cnpm --registry=https://registry.npm.taobao.org2:配置环境变量系统环境变量配置如下:新建系统环境变量node-path如下配置用户path3、cnpm 执行失败cnpm : 无法加载文件 E:\Prog原创 2020-05-22 12:02:31 · 700 阅读 · 0 评论 -
遍历json树结构对象
let 0 ={ "1": { "1": { "1": ["all"] } }, "2": { "all": { "all": ["all"] } }}this.traverse(o)调用:traverse(o) { for (let i in o) { if (!!o[i] && typeof o[i...原创 2020-04-26 21:28:24 · 321 阅读 · 0 评论 -
axios 封装
调用:let a = get(URL1, {api: 'getPlatformSetup', user: this.USER,}) a.then(arr=>{ console.log(arr); },error=>{ console.log(error); }) let b = post(URL2, {api: 'addRoomInfo', sid: 1,...原创 2019-11-25 17:38:58 · 86 阅读 · 0 评论 -
es6 promise 使用
es6 promise 使用1:promise 异步多个请求判断结果获取let p1= this.verificationPicFile(URL2,'mediaServer');let p2= this.createPromise**(URL2,'mediaServer');let p3= this.createPromise**(URL2,'mediaServer1');Promise...原创 2019-11-25 15:03:54 · 159 阅读 · 0 评论