摘要: angular资料真的是难找+混乱。 npm install --save js-base64 使用的文件引入:import {Base64} from 'js-base64/base64' 使用: this.password=Base64.encode(‘abc123’) 阅读全文
posted @ 2020-09-09 16:17 倒带_with 阅读(1584) 评论(0) 推荐(0) 编辑
摘要: 一、固定列宽,文本过长用省略号‘...’显示 方案:使用css实现(本例在angular环境) :host ::ng-deep { .ant-table-small > .ant-table-content > .ant-table-body > table > .ant-table-tbody > 阅读全文
posted @ 2020-05-06 17:58 倒带_with 阅读(469) 评论(0) 推荐(0) 编辑
摘要: angular6 + ng - zorro(x1.8.1版本)html页nzShowIcon = "true"(nzExpandChange) = 'expendNode($event)' TS页1、展开、收起图标转换//折叠、展开图标转换expendNode(event) { console.lo 阅读全文
posted @ 2020-03-30 20:04 倒带_with 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 前言: 项目有需求实现指定内容全屏功能,网上找一圈发现angular框架实现较少,有的文章还有些问题,修改后终于实现了 一、安装依赖 npm install screenfull --save 二、模块内引入 ts文件 import * as screenfull from "screenfull" 阅读全文
posted @ 2020-01-14 14:01 倒带_with 阅读(1287) 评论(0) 推荐(1) 编辑
摘要: 原理:获取某个html片段,然后将其打印 //id为打印内容最外层节点id名称print(id){ //获取打印内容最外层dom节点 let bdHtml = window.document.getElementById(id).innerHTML; //打印内容赋值innerHTML绘制新页面(w 阅读全文
posted @ 2019-11-11 16:23 倒带_with 阅读(1712) 评论(0) 推荐(1) 编辑
摘要: //url请求地址,datas传给后台的参数,fileName文件名,format文件类型后缀名如.xls downLoadFile(url,datas,fileName,format){ this.http.post(url, datas, { responseType: 'blob' }).su 阅读全文
posted @ 2019-11-11 16:11 倒带_with 阅读(2789) 评论(0) 推荐(0) 编辑
摘要: 本例在angular6框架下实现 HTML <input type='file' id='upLoadFile'> TS let files = document.getElementById('upLoadFile').files[0]; const formData=new FormData() 阅读全文
posted @ 2019-11-11 15:13 倒带_with 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 前言: 项目中遇到一个将表格数据输出为excel文件的需求,本需求只是简单地将简单表格的数据输出到excel,并没有涉及表格样式的复杂处理。 1、安装依赖环境 npm install file-saver --save npm install @types/file-saver --save-dev 阅读全文
posted @ 2019-11-05 17:16 倒带_with 阅读(837) 评论(0) 推荐(1) 编辑
摘要: 参考文章:廖雪峰的官方网站:JavaScript:promise章节 ES6 Promise用法小结 为了解决多个异步操作存在依赖关系的调用问题,考虑使用promise方法。比如函数func2依赖函数func1的接口数据,常规的方法是把func2放到func1的回调函数里执行。但如果出现多个依赖就得 阅读全文
posted @ 2019-09-26 16:03 倒带_with 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 关键字: JS、引用、赋值、对象复制、数组复制等 前言: 今天在用angular做父子组件的一些数据传递和处理时发现,子组件通过事件传给父组件的数据被父组件处理后影响到了子组件。event是子组件传递过来的参数,这里父组件删除item.key后,发现子组件数据的key也没了。查阅资料后发现是对象数组 阅读全文
posted @ 2019-09-20 15:46 倒带_with 阅读(2201) 评论(0) 推荐(0) 编辑