微信小程序不支持set集合吗?
data: { suggestionGoodSelect: new Set(), suggestionBadSelect: new Set() }, |
onSuggestionGoodSelect: function (e) { let selectIndex = e.currentTarget.dataset.index; let goodSelect = this .data.suggestionGoodSelect; goodSelect.add(selectIndex); this .setData({ suggestionGoodSelect: goodSelect }) }, |
在goodSelect.add(selectIndex)时报错了提示
goodSelect.add is not a function ; [Component] Event Handler Error @ pages/comment/comment #bound onSuggestionGoodSelect TypeError: goodSelect.add is not a function |