因为在这段代码中,虽然使用了toString()方法将boxs.boxType转换成字符串,但是没有将其重新赋值给boxs.boxType。因此,即使调用了toString()方法,boxs.boxType仍然保持着原来的类型。应该将转换后的字符串重新赋值给boxs.boxType,如下所示:

if(boxs.boxType !== null){
    boxs.boxType = boxs.boxType.toString()
}else{
    delete boxs.boxType
}
let boxs = boxCodeitemboxCodeboxTypeitemboxTypeboxTypeNamethisboxsitemboxTypeisBox0isSelectfalsepackageCountitempackageCount							ifboxsboxType !== null								boxsboxTypetoString							else								d

原文地址: https://www.cveoy.top/t/topic/ban0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录