一、代码
getcontext(name, value, pic) {
let context = { name: "", value: "", img: "" };
context.name = name;
//转变数字类型为字符串数组类型
let arry = value.toString().split("");
console.log("arry123", arry);
if (arry.length > 3 ) {
arry.splice(arry.length-3, 0, ",");
}
//转化为一个整体数组
let num=arry.join('');
console.log("arry1", num);
context.value = num;
context.img = pic;
return context;
},