原创 DataTable_配置參數
$('#dataTable_ID1').dataTable({ //"aaSorting" : [[1, "asc"]], //默認的排序方式,第1+1列,升序排列 "aLengthMenu" : [5, 10, 25,
原创 四捨五入方法,保留兩位小數
Math.round(8.7656*100)/100
原创 把1轉化爲001
轉載:https://cloud.tencent.com/developer/ask/32933/answer/44175 只是爲了演示javascript的靈活性:你可以使用一個oneliner來實現這一點。 function pad
原创 node _.clone數組的覆蓋問題
var new_tblAbsenceProcess = [{ "_id":"5d27ed0639daad06f2bc7a35", "people_id":"5aa62a0d795dd7c8c12f0712",
原创 post請求方式
.on('click','#btn_export',function(event){ event.preventDefault(); var url = '/admin/people_self_modify/downlo
原创 ansyn 異步常用方法
串行且無關聯 場景:提取某學校大三學生的學生信息(假設每個班級存儲在一個獨立的數據表裏) 分析:每個班級的學生之間是無關聯的,假設共有3個班級,我們需要遍歷3個表,把提取出的學生信息返回客戶端一個json,如下 { "1班":[{nam
原创 控制頁面文字不能選中
* { moz-user-select: -moz-none -moz-user-select: none; -o-user-select:none; -khtml-user-select
原创 只能輸入中文,及中文標點符號正則/只能輸入英文,及英文標點符號正則
//只能輸入中文,及中文標點符號正則 var regChina = /^[\u4e00-\u9fa5\s\·\~\!\@\#\¥\%\……\&\*\(\)\——\-\+\=\【\】\{\}\、\|\;\‘\’\:\“\”\《\》\?\,
原创 如何將循環數組多個合併成一個(數組多個合併成一個)
var result = []; for (let i = 0; i < totalTimes.length; i++) { result = result.concat(totalTimes[i]); } console.l
原创 模仿網頁ctrl+F搜索功能
模信插件:https://www.helloweba.net/javascript/246.html https://www.helloweba.net/demo/findcontent/ <!DO
原创 將現有數組重新分組(將數組分每四個渲染到一組)
轉載自:https://blog.csdn.net/qtfying/article/details/83014025 最近做項目有一個小功能,將數組玩出了花樣,就是要將ajax從後臺拿到的數據,四個一組,渲染到頁面上,特此記下筆記,以作安
原创 mac 如何安裝nvm
nvm 與 n 的區別 node 版本管理工具還有一個是 TJ大神的 n 命令,n 命令是作爲一個 node 的模塊而存在,而 nvm 是一個獨立於 node/npm 的外部 shell 腳本,因此 n 命令相比 nvm 更加侷限。 由於
原创 倒計時組件
<template> <div class="countDownTime"> <p class="ce2">{{parseInt(seconds / 60)}}分{{seconds % 60}}秒</p> </div> </templat
原创 一些常用的公共方法
// 獲取當前時間 YYYY-MM-DD hh:mm:ss格式的時間 export function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; va
原创 vue SHA256 加密
import crypto from "crypto"; export const SHA256 = val => { const hash = crypto.createHash("sha256"); hash.update(val);