/** * 扫码后获取指定的物料的属性 * @param {Object} str 扫描得到的字符串 * @param {Object} attr 需要获取到的索引值 */ export function getAttrValue(targetStr,attr) { let endStr = ''; // let targetStr = str.replace(/\s/g,'') //字符串拆分数组 const targetArr = targetStr.split(','); if(attr != -1){ endStr = targetArr[attr].replace(/^["']|["']$/g, ''); } //循环数组 // for(let i=0;i 9 ? date : '0'+date; };