摘要: 执行上下文 执行上下文概念 当代码运行时,会产生一个对应的执行环境,在这个环境中,变量会被事先提出来(变量提升),代码从上往下开始执行,就叫做执行上下文。 注:在定义变量是未直接赋值,使用默认值 undefined。 在 JavaScript 的世界里,运行环境有三种,分别是: 全局环境:代码首先进 阅读全文
posted @ 2021-12-02 11:03 影的记忆 阅读(60) 评论(0) 推荐(0) 编辑
摘要: Vue + TypeScript 使用 vue-property-decorator 用法总结 简介 要使vue支持ts写法,我们需要用到vue-property-decorator,这个组件完全依赖于vue-class-componet 安装 vue-property-decorator npm 阅读全文
posted @ 2021-11-25 10:13 影的记忆 阅读(2842) 评论(0) 推荐(0) 编辑
摘要: Vue 中使用 extend 开发组件 简介:再开发过程中那面会遇到自定义 loading alert 等全局组件,这里我们可以使用 vue 中的extend 来帮助我们完成 一个简单extend例子,如下: 新建 index.js 文件 import Vue from "vue"; import 阅读全文
posted @ 2021-11-15 18:33 影的记忆 阅读(303) 评论(0) 推荐(0) 编辑
摘要: forEach 和 await/async 的问题 最近在刷面试提的时候看见这样一道题 const list = [1, 2, 3] const square = num => { return new Promise((resolve, reject) => { setTimeout(() => 阅读全文
posted @ 2021-11-12 09:30 影的记忆 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 监听浏览器切屏 为了完成验证用户在切换浏览器tab时进行登录再次认证需求需要监听浏览器切换窗口 if (document.hidden !== undefined) { document.addEventListener('visibilitychange', () => { console.log 阅读全文
posted @ 2021-11-02 14:25 影的记忆 阅读(375) 评论(0) 推荐(0) 编辑
摘要: # canvas 基本功能介绍 - canvas 能做什么 1. 绘制简单图形线条 2. 裁剪图片 - 开始绘制画布 新建html文档添加 canvas标签 ```html <div style="position: relative;"> <canvas id="canvas" width="80 阅读全文
posted @ 2021-11-02 10:10 影的记忆 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Vue 中使用 TypeScript axios 使用方式 方式一 import axios from 'axios'; Vue.prototype.$axios = axios; // 在 .vue 文件中使用 // 使用 this as any 是去掉 ts 的类型检测 axios 是挂载成功的 阅读全文
posted @ 2021-10-29 11:05 影的记忆 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: VUE 项目中使用 Typescript 第一节:项目起步 Vue 中使用 TypeScript 项目中主要使用到的第三方依赖 vue2 vue-class-component vue-property-decorator less vue-router vuex vuex-class 搭建项目 / 阅读全文
posted @ 2021-10-28 23:21 影的记忆 阅读(1293) 评论(0) 推荐(0) 编辑