fix: use reactive previewableCount

This commit is contained in:
Lhcfl 2024-05-07 23:31:45 +08:00
parent 1d0ea11eea
commit 42886f054d

View file

@ -40,7 +40,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { computed, onMounted, ref } from "vue";
import type { entities } from "firefish-js"; import type { entities } from "firefish-js";
import PhotoSwipeLightbox from "photoswipe/lightbox"; import PhotoSwipeLightbox from "photoswipe/lightbox";
import PhotoSwipe from "photoswipe"; import PhotoSwipe from "photoswipe";
@ -207,9 +207,9 @@ const isModule = (file: entities.DriveFile): boolean => {
); );
}; };
const previewableCount = props.mediaList.filter((media) => const previewableCount = computed(
previewable(media), () => props.mediaList.filter((media) => previewable(media)).length,
).length; );
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>