![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端笔记
喵咪那个汪~
这个作者很懒,什么都没留下…
展开
-
Angular 生成二维码 (JS、angular2-qrcode、ng2-qrcode)
npm install ng2-qrcode --save问题描述:npm ERR! ng2-qrcode@0.1.1 preinstall: `npm i typings -g`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the ng2-qrcode@0.1.1 preinstall script.npm ERR! This is probably not a problem with npm. There is likely ...原创 2021-08-05 15:07:25 · 936 阅读 · 0 评论 -
angular input 文本自动全选 + 扫描枪(回车)监听事件
扫描枪触发事件即keyup 13 (键盘enter事件)HTML<input nz-input #scan [(ngModel)]="scanVal" (keyup.enter)="dealScanInput(scanVal)" name="scanVal">TSimport { ViewChild, ElementRef } from '@angular/core';// 定义元素@ViewChild('scan', { static: f..原创 2021-05-17 15:43:44 · 686 阅读 · 0 评论 -
前端文件下载
<a> 标签 下载 HTML原理 //创建URL 利用a标签属性下载<a href="url" download="<fileName>">导出/下载</a> JS实现方法 let blobUrl = window.URL.createObjectURL(result); const a = do...原创 2020-01-13 10:22:28 · 233 阅读 · 0 评论 -
css样式优先级
权重值为主,权重值相同,应用最后定义的样式外部样式表 < 内部样式表 < 内联样式权重规则:类选择器 < 类派生选择器 < ID选择器 < ID派生选择器 一:内联样式,权重1000,即标签内的style属性设置的样式 二:ID选择器,权重100,例如:#id{...} 三:类选择器,伪类选择器,属性选择器,权重10,例如.c...原创 2018-08-09 22:24:10 · 151 阅读 · 0 评论 -
js获取style.left为什么为空?
原因:element.style.left 只能获得element的行内样式,所以一般写在style或css文件内的left就无法获得。解决办法:用element.offsetLeft来获取原创 2018-08-13 17:02:59 · 1404 阅读 · 1 评论 -
select文字右对齐/居中
1、添加 dir 属性,适合中文,但是会导致英文单词或者有空格的地方文字变成从右到左。<select dir="rtl"> <option>Foo</option> <option>bar</option> <option>to the right</optio原创 2018-08-31 14:56:17 · 3735 阅读 · 0 评论