上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: 在后端接口使用了cors跨域处理(后端通过修改Access-Control-Allow-origin来支持跨域)浏览器发出cors相关请求时会在头信息之中,增加一个Origin字段。 浏览机器一旦发现跨域请求,就会自动添加一些附加的头信息,有时还会多出一次附加的请求(浏览器自动完成,用户不会察觉), 阅读全文
posted @ 2022-09-27 16:49 瑞瑞大人 阅读(846) 评论(0) 推荐(0) 编辑
摘要: ar str ='https://xx.eerr.com/design/certified?channel=mtxxswaa888&bd_vid=xxx' var reg = /([^?&=]+)=([^?&=]+)/g while(res = reg.exec(str)){ console.log 阅读全文
posted @ 2022-06-28 19:45 瑞瑞大人 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 全局属性 contenteditable 是一个枚举属性,表示元素是否可被用户编辑。如果可以,浏览器会修改元素的部件以允许编辑。 带有contenteditable标签的里面的标签内容会正常展示,类似v-html的效果 使用案例: <!DOCTYPE html> <html lang="en"> < 阅读全文
posted @ 2022-06-27 15:07 瑞瑞大人 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 单个css选择器的优先级 内联 > ID选择器 > 类选择器 > 标签选择器。 当有多个CSS选择器时(层级一致)怎么判断优先级 优先级是由 A 、B、C、D 的值来决定的,其中它们的值计算规则如下: A 如果存在内联样式,那么 A = 1, 否则 A = 0; B 的值等于 ID选择器 出现的次数 阅读全文
posted @ 2022-06-22 14:48 瑞瑞大人 阅读(108) 评论(0) 推荐(0) 编辑
摘要: function lineLine ( a1, a2, b1, b2 ) { // b1->b2向量 与 a1->b1向量的向量积 var ua_t = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x); // a1->a2向 阅读全文
posted @ 2022-06-22 10:36 瑞瑞大人 阅读(385) 评论(0) 推荐(0) 编辑
摘要: css文件 :root.light { --background--main: rgba(245, 245, 245, 1); } :root.dark { --background--main: rgba(15, 15, 15, 1); } body {background-color: var( 阅读全文
posted @ 2022-06-07 16:43 瑞瑞大人 阅读(172) 评论(0) 推荐(0) 编辑
摘要: function downLoad(url){ console.log(url) const oA = document.createElement("a"); oA.download = '';// 设置下载的文件名,默认是'下载' oA.href = url; document.body.app 阅读全文
posted @ 2022-03-14 14:51 瑞瑞大人 阅读(464) 评论(0) 推荐(0) 编辑
摘要: class Scheduler{ //正在执行的顺序 constructor(max){ //当前正在执行的任务个数 this._count = 0; //最大上限数 this._max = max; this._taskQueue = []; } add(promiseCreator){ cons 阅读全文
posted @ 2022-01-17 12:47 瑞瑞大人 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 通过Object.defineProperty实现了对对象属性的监听,但是Object.defineProperty对数组已有元素也是实现监听的,那么为什么vue中没有提供这一功能,使得arr[已有元素下标]=val变成响应式 Object.defineProperty 可以做到对数组的监听,它是支 阅读全文
posted @ 2022-01-10 17:30 瑞瑞大人 阅读(412) 评论(1) 推荐(0) 编辑
摘要: function set(target: Array<any> | Object, key: any, val: any): any { // isUndef 是判断 target 是不是等于 undefined 或者 null 。 //isPrimitive 是判断 target 的数据类型是不是 阅读全文
posted @ 2022-01-10 15:52 瑞瑞大人 阅读(67) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页