我想提取 filterPillvalue 并將其放入一個數組中,數組的輸出應該是這樣的:mode = ['anyValue','Repsonding','Unresponsive']這是我的嘗試this.items = [ { filterPillValue: 'anyValue', id: 'all-systems', label: 'All systems' }, { filterPillValue: 'Responding', id: 'responding', label: 'Responding systems' }, { filterPillValue: 'Unresponsive', id: 'unresponsive', label: 'Unresponsive systems' }];我的嘗試在這種情況下不起作用mode = this.items.filter(x=>x.filterPillValue);
如何從對象中提取值并將其放入數組
肥皂起泡泡
2023-03-18 17:39:37