摘要:
在开发过程中,有时候需要js生成全局唯一标识符,在java中可以使用uuid,但是JS中没有现成的函数。 总结了一下,JS生成唯一标识符的几种方法。 第一种: function uuid() { var s = []; var hexDigits = "0123456789abcdef"; for 阅读全文
摘要:
import * as fs from 'fs' import * as http from 'http' import * as iconv from 'iconv-lite' import path from 'path' import openapiTS from 'openapi-types 阅读全文
摘要:
app.js——小程序逻辑,通常执行一些初始化的工作,例如获取用户信息,地址等授权 app.json——小程序公共配置,放置一些公共参数,例如页面的路径 app.wxss——小程序公共样式表,定义一些全局样式 一个小程序页面由4个文件组成,所以要创建一个小程序页面,至少包含下面两个文件的组成部分: 阅读全文
摘要:
 阅读全文
摘要:
let result = [] let objT = {} for (var i = 0; i < Obj.value.planCode.length; i++) { if (!objT[Obj.value.planCode[i].key]) { result.push(Obj.value.plan 阅读全文
摘要:
var alphabet= String.fromCharCode(64 + parseInt(填写数字); 阅读全文
摘要:
1、最简单的方法,就是使用“!==”进行判断,这种方法在工作中很常见,可以看出该方法可以判断继承来的属性。 1 2 3 4 let obj = { x: 1 }; obj.x !== undefined; // true 有x属性 obj.y !== undefined; // false 无y属性 阅读全文
摘要:
function deepCopy(target) { let result; if (Object.prototype.toString.call(target) "[object Array]") { result = []; target.forEach((element) ⇒ { resul 阅读全文
摘要:
export function parseTime (time: Date | number | string, cFormat?: string) { if (arguments.length 0) { return null } const format = cFormat || '{y}-{m 阅读全文
摘要:
// 公共枚举转换 export function commonEnumFormat (options: Array<optionsType>, state: string | number) { if (options.length > 0 && typeof state !== 'undefin 阅读全文