摘要:
我们在项目中安装相关依赖 npm install jszip file-saver --save 创建一个js文件,并引入依赖 import JSZip from 'jszip' import FileSaver from 'file-saver' 开始调用 DownLoad () { this.M 阅读全文
摘要:
当需要使用淘宝镜像时也就是所谓的npm切换至cnpm步骤如下: 在项目中或者window小黑窗 npm config set registry https://registry.npm.taobao.org 建议测试下是否切换成功,可以运用下方命令测试 npm config get registry 阅读全文
摘要:
数据结构: let data = [ { "id": 301, "name": "运营部门", "parentId": 300, "code": "op", "status": 0, "des": null, "children": [ { "id": 302, "name": "运营部门-a", 阅读全文
摘要:
import axios from 'axios'; import qs from 'querystring'; axios.post(url, qs.stringify(params), { headers: { 'Content-Type': 'application/json;charset= 阅读全文
摘要:
const formatTime = (millisecond)=>{ let seconds = Math.round(millisecond / 1000); let result = []; let count = 2; while(count >= 0) { let current = Ma 阅读全文
摘要:
input只能输入小数点保留2位的正数 <input type="text" placeholder="请输入" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/ 阅读全文
摘要:
将日期时间转换为指定格式,如:YYYY-mm-dd HH:MM表示2020-10-19 11:40 function dateFormat(fmt, date) { let ret; const opt = { "Y+": date.getFullYear().toString(), // 年 "m 阅读全文
摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body id="lia-body"> <div class="lia-content"> <div cla 阅读全文
摘要:
//超过一行省略号 overflow: hidden; white-space: nowrap; text-overflow: ellipsis; //超过两行省略号 overflow: hidden; text-overflow: ellipsis; display: box; display: 阅读全文
摘要:
如果只是一个输入框,要实现就非常的简单了,输入框的内容和数据绑定,给数据加一个监听器就可以了,代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Vue</title> <script src="https://cdn. 阅读全文