摘要: 直接在报错的前一行添加 // @ts-ignore 阅读全文
posted @ 2020-09-03 10:56 hannahY 阅读(1753) 评论(0) 推荐(1) 编辑
摘要: 第一种:直接通过连接下载Excel window.location.href = 'https://x.x.x.243/static/sample/template.xlsx'; 第二种:后端返回文件流下载导出Excel 首先 axios需要设置 responseType: 'blob'; 如果需要 阅读全文
posted @ 2020-09-03 10:48 hannahY 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 一、生成的是.csv文件,伪装成Excel文件,很多情况打不开 public downloadExcel(){ let tableJson = [ { name:'AML', phone:'123456', email:'123@123456.com' }, { name:'AML', phone: 阅读全文
posted @ 2020-08-27 10:56 hannahY 阅读(4406) 评论(0) 推荐(0) 编辑
摘要: 去重(性能由高到低) 一、New Set() let arr = [1,1,'true','true',true,true,15,15,false,false, undefined,undefined, null,null, NaN, NaN,'NaN', 0, 0, 'a', 'a',{},{}] 阅读全文
posted @ 2020-08-27 10:30 hannahY 阅读(199) 评论(0) 推荐(0) 编辑
摘要: a.addEventListener('event', function, true/false) a.removeEventListener('event', function, true/false) 1. 不要监听匿名函数; 2. 确保监听的函数和取消监听的函数是同一个函数; 3. 当remo 阅读全文
posted @ 2020-04-13 12:55 hannahY 阅读(1333) 评论(0) 推荐(0) 编辑
摘要: 一、在angular中如何使用jQuery npm install jquery --save npm install @types/jquery --sa ve-dev import * as $ from 'jquery'; 二、bootstrap的使用 引入cdn直接使用 npm安装,需要先安 阅读全文
posted @ 2020-01-21 11:15 hannahY 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 基础知识 创建组件 ng g component 组件名称 对ts文件下的@Component的使用 模板 template 不仅可以配置模板地址templateUrl,还可以配置成template:自定义模板内容 设置样式 styles 设置样式不仅可以在@Component下配置styleUrl 阅读全文
posted @ 2020-01-21 11:10 hannahY 阅读(257) 评论(0) 推荐(0) 编辑
摘要: e2e :端对端的测试目录,主要是集成测试操作的 node_modules :项目的模块依赖目录 src :项目的代码目录 app :包括应用的组件和模块 app.component.css :全局样式文件 app.component.html :全局模板文件 app.component.spec. 阅读全文
posted @ 2020-01-19 11:21 hannahY 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 一、配置及基本操作 全局安装TypeScript cnpm install -g typescript tsc -v 查看版本 tsc hello.ts 编译,将ts文件编译成js文件 二、定义变量类型 var str: string = 'hello'; var num: number = 1; 阅读全文
posted @ 2020-01-17 18:01 hannahY 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一、定义路由 方法一:直接在app.module.ts中配置 1 import { BrowserModule } from '@angular/platform-browser'; 2 import { NgModule } from '@angular/core'; 3 import { App 阅读全文
posted @ 2020-01-13 17:59 hannahY 阅读(136) 评论(0) 推荐(0) 编辑