摘要: 浏览器缓存 场景: 首先我们需要知道JS中的变量有这样的问题:变量只在当前的会话期内有效。即只要刷新页面,之前存储的变量就被回收了。那么我们如何让之前所存储的变量在刷新页面之后还存在呢, 看个案例: 本地存储的好处显而易见,一是避免取回数据前页面一片空白,如果不需要最新数据也可以减少向服务端请求的次 阅读全文
posted @ 2022-08-31 16:36 Mrco7837 阅读(687) 评论(1) 推荐(0) 编辑
摘要: <template> <div> {{ data }}</div> <div> {{ copyData }} </div> <div> {{ formData.code }}</div> <button @click="handleAdd">add</button> <button @click=" 阅读全文
posted @ 2022-08-31 14:56 Mrco7837 阅读(32) 评论(3) 推荐(0) 编辑
摘要: fatal: Authentication failed for 'http:xxxxxxxxxx.git/' git push / git pull / git clone都报错fatal: Authentication failed for 'http:xxxxxxxxxx.git/' 终极解决 阅读全文
posted @ 2022-03-04 14:10 Mrco7837 阅读(593) 评论(0) 推荐(0) 编辑
摘要: // 垂直方向的滚动到页面的指定位置 const el = document.getElementsByClassName('test')[0] window.scrollTo({ top: window.screen.availHeight - el.getBoundingClientRect() 阅读全文
posted @ 2021-08-20 14:58 Mrco7837 阅读(67) 评论(0) 推荐(0) 编辑
摘要: // 批量调用接口校验 componentDidMount() { this.setState({ data: this.props.data, loading: true }, () => { let chooseData = this.state.data const company = cho 阅读全文
posted @ 2021-08-20 14:13 Mrco7837 阅读(300) 评论(0) 推荐(0) 编辑
摘要: this谁调用指向谁,没人调用就指向window argument即为参数, 阅读全文
posted @ 2021-08-20 14:06 Mrco7837 阅读(31) 评论(1) 推荐(1) 编辑
摘要: 1 // 引入htmlcanvas 2 import Vue from 'vue'; 3 import html2canvas from 'html2canvas'; 4 5 Vue.prototype.$html2canvas = html2canvas; 6 7 // 点击保存调用方法 8 ha 阅读全文
posted @ 2021-08-20 14:05 Mrco7837 阅读(244) 评论(1) 推荐(0) 编辑
摘要: 泛型 类的泛型 // 类型断言 as 可以转为想要的类型 let name5 : string | number // = 3 (name5 as string).toLocaleLowerCase(); (name5 as number).toFixed(); 接口 阅读全文
posted @ 2021-06-11 19:15 Mrco7837 阅读(58) 评论(1) 推荐(0) 编辑
摘要: export {} let name: number = 10 console.log(name) let person: Array<number> = [10] console.log(person) let age:[number, string] = [10, '99'] // 枚举 enu 阅读全文
posted @ 2021-06-11 14:33 Mrco7837 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 想要设置scoped的子组件里的元素进行控制可以使用'>>>'或者'deep' <style lang="css" scoped> .gHeader /deep/ .name{ //第一种写法 color:red; } .gHeader >>> .name{ //二种写法 color:red; } 阅读全文
posted @ 2021-04-15 18:35 Mrco7837 阅读(65) 评论(0) 推荐(0) 编辑