上一页 1 2 3 4 5 6 7 ··· 20 下一页
摘要: 什么是跨域 浏览器有一个重要的安全策略,称之为「同源策略」 其中,源=协议+主机+端口源=协议+主机+端口源=协议+主机+端口,两个源相同,称之为同源,两个源不同,称之为跨源或跨域 比如: 源 1 源 2 是否同源 www.baidu.com www.baidu.com/news ✅ www.bai 阅读全文
posted @ 2022-05-25 16:17 Samsara315 阅读(62) 评论(0) 推荐(0) 编辑
摘要: const list = ['1/3', '1/4', '1/5', '1/6']; console.log(CalculateFraction(list)); function CalculateFraction (list) { if (list.length 0) { return false 阅读全文
posted @ 2022-04-27 19:20 Samsara315 阅读(272) 评论(0) 推荐(0) 编辑
摘要: // 被观察者类 class Subject { constructor(name) { this.name = name this.observers = [] this.state = 'xx' } // 被观察者提供订阅观察者方法 attach(observer){ this.observer 阅读全文
posted @ 2022-02-21 14:36 Samsara315 阅读(139) 评论(0) 推荐(0) 编辑
摘要: // 压缩字符串 'aaaaaabbbbbcccca' => 'a6b5c4a1' function compressStr(strs = 'aaaaaabbbbbccccaa') { let pre = strs[0] let curNum = 1 let res = '' for (let i 阅读全文
posted @ 2022-02-21 14:34 Samsara315 阅读(950) 评论(0) 推荐(0) 编辑
摘要: // 新数据插入到链表尾部; // 每当缓存命中(即缓存数据被访问),则将数据移到链表尾部 // 当链表满的时候,将链表头部的数据丢弃。 class LRUCache { constructor(capacity) { this.capacity = capacity this.cache = ne 阅读全文
posted @ 2022-02-21 14:33 Samsara315 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 今天在测试一个demo页面的时候发现给body设置高度50vh和红色背景,但是红色却占满了屏幕,网上查了查,原来html根标签没有设置背景色时,会默认使用body的背景色,所以单独再给html设置一个背景就ok了 阅读全文
posted @ 2022-01-17 18:04 Samsara315 阅读(177) 评论(0) 推荐(0) 编辑
摘要: <template> <div class="base-count-down"> <div class="content"> <slot v-bind="{ d: days, h: hours, m: mins, s: seconds, hh: `00${hours}`.slice(-2), mm: 阅读全文
posted @ 2022-01-17 15:03 Samsara315 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 对于容器属性align-content, 要让它生效的条件是:必须显式的设置布局方向 如果布局方向为横向主轴:flex-direction: row; 1、此时 align-content 的变化体现在竖直方向 2、如果要让 align-content: stretch;生效,这个时候应该去掉子项的 阅读全文
posted @ 2022-01-14 11:50 Samsara315 阅读(103) 评论(0) 推荐(0) 编辑
摘要: <el-form-item label="部门" prop="departments" > <el-cascader v-model="form.departments" :options="departOptions" :show-all-levels="false" :props="{ labe 阅读全文
posted @ 2022-01-13 15:47 Samsara315 阅读(1539) 评论(0) 推荐(0) 编辑
摘要: const delay = function (time) { return new Promise((resolve, reject) => { setTimeout(() => { console.log(time); resolve(time) }, time); }) } let tasks 阅读全文
posted @ 2022-01-04 15:43 Samsara315 阅读(329) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 20 下一页