vue数组每个元素后面添加一个逗号然后把最后一个元素的逗号删掉

169 阅读1分钟
        this.ipList = this.ipList.map((item, index) => {

                  if (index === this.ipList.length - 1) {

                    return item.toString();

                  } else {

                    return item.toString() + ",";

                  }

                });