Fix: 一括で選択できない

This commit is contained in:
mattyatea 2023-10-19 18:50:07 +09:00
parent 8ac5dad60b
commit 91edf38871
1 changed files with 6 additions and 5 deletions

View File

@ -64,13 +64,14 @@ const pagination = {
}; };
const selectAll = () => { const selectAll = () => {
if (selectedEmojis.value.length > 0) { if (selectedEmojis.value.length > 0) {
selectedEmojis.value = []; selectedEmojis.value = [];
} else { } else {
selectedEmojis.value = emojisPaginationComponent.value.items.map(item => item.id); selectedEmojis.value = Array.from(emojisPaginationComponent.value.items.values(), item => item.id);
} }
}; };
const toggleSelect = (emoji) => { const toggleSelect = (emoji) => {
if (selectedEmojis.value.includes(emoji.id)) { if (selectedEmojis.value.includes(emoji.id)) {
selectedEmojis.value = selectedEmojis.value.filter(x => x !== emoji.id); selectedEmojis.value = selectedEmojis.value.filter(x => x !== emoji.id);