数字取整可用于input change 的数字输入处理/** 数字整形 */ numInputChange(val, max) { // 转数字 let transferNum = parseInt(val); // 小于0 if(transferNum < 0) { transferNum = Math.abs(transferNum); } else if(transferNum === 0) { transferNum = 1; } else if(transferNum >= max) { transferNum = max; } return transferNum; },简单Ajax实现function simpleAjax(options) { options = options || {}; options.async = options.async || true; options.type = (options.type || 'GET').toUpperCase();
lettered
生,亦我所欲也;义,亦我所欲也。