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 = () => {
if (selectedEmojis.value.length > 0) {
selectedEmojis.value = [];
} else {
selectedEmojis.value = emojisPaginationComponent.value.items.map(item => item.id);
}
if (selectedEmojis.value.length > 0) {
selectedEmojis.value = [];
} else {
selectedEmojis.value = Array.from(emojisPaginationComponent.value.items.values(), item => item.id);
}
};
const toggleSelect = (emoji) => {
if (selectedEmojis.value.includes(emoji.id)) {
selectedEmojis.value = selectedEmojis.value.filter(x => x !== emoji.id);