
JS
一Ⅱ彡
这个作者很懒,什么都没留下…
展开
-
ecology9-谷歌浏览器下-pdf.js在渲染时部分发票丢失文字 问题定位及解决
ecology9 谷歌浏览器下,pdf.js在渲染时不放呢发票丢失文字问题定位及解决原创 2023-02-26 11:46:37 · 1614 阅读 · 0 评论 -
Ajv jtd时间字符串转timestamp
import Ajv from 'ajv/dist/jtd'const params = {"date":"2022-01-27T22:12:26.291Z"};const ajv = new Ajv({ parseDate: true, allowDate: true });const schema = {properties: { date: { type: 'timestamp' }, } }; const parse = ajv.compileParser(schem原创 2022-02-22 22:38:17 · 231 阅读 · 0 评论 -
midway代理IP-Axios使用代理IP请求
const res = await axios({ method: 'post', url, headers, data: body, proxy: { host: '183.167.217.152', port: 63000 }});参考:Axios使用代理IP请求转载 2021-07-12 18:20:24 · 680 阅读 · 0 评论 -
JS时间戳格式化
function rTime(date) { var json_date = new Date(date).toJSON(); return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') }let date = rTime('2020-06-27T14:20:27.000000Z');console.log(date)转载 2021-06-01 10:08:03 · 325 阅读 · 0 评论 -
fast-xml-parse解析xml-丢失大整数精度
解决改用xml2js解析xml。import * as xml2js from 'xml2js';export const xmlToJson = (xml: string) => { let xmlJson = ''; xml2js.parseString(xml, { explicitArray: false }, function (err, json) { xmlJson = json; }); return xmlJson;};注意,xml2js解析出来的原创 2021-05-14 10:40:22 · 554 阅读 · 0 评论 -
使用fast-xml-parse转object为xml,添加属性标签
准备安装fast-xml-parser@3.3.4npm install fast-xml-parser@3.3.4重点属性attributeNamePrefix : prepend given string to attribute name for identificationattrNodeName: (Valid name) Group all the attributes as properties of given name.ignoreAttributes : Ignore a原创 2021-05-10 12:05:49 · 1273 阅读 · 1 评论 -
Web缓存-localStorage
工具类const storage = { set(key, value) { localStorage.setItem(key, value) }, get(key) { return localStorage.getItem(key) }, remove(key) { localStorage.removeItem(key) }}export default storage应用新增表单意外退出时,缓存表单数据 mounted () {原创 2021-03-22 11:25:54 · 321 阅读 · 1 评论 -
JS-设置、获取对象的键
Object.defineProperty-设置对象的键将[{“name”:“刘备”,phone:“17783453234”}]转化为[{“刘备”:“17783453234”}] handleFamilyNumber () { let obj = []; this.family_number.forEach((item, index, arr) => { let it = {}; Object.defineProperty(it, it原创 2021-03-18 14:30:21 · 1240 阅读 · 0 评论 -
JS-indexOf的应用
报错当图片参数avatar_path为空时控制台报错:smart-retire-webnull&size=168:1 GEThttp://192.168.0.49:5052/smart-retire-webnull&size=168404分析 <template #icon> <van-image :src="getDynamicImgSrc(item.avatar_path+'&size=168')"原创 2021-03-03 16:57:11 · 149 阅读 · 1 评论