如下图: 引号跟(会引起解析错误, 解决办法是let memberNames = ''; 加一个分号" ; "
也可以这样:
let memberNames = ''
const arr = selectedRows || []
arr.forEach((item, idx) => {
let isEqueal = idx == selectedRows.length - 1
memberNames += (item.name + (isEqueal ? '' : ','))
})