Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ const onOff = computed({

<style scoped lang="scss">
.card-width {
width: 100%;
width: 22em;
max-width: 100%;
border: none;
border-left: 4px solid var(--q-consumer);
border-radius: 15px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<div class="consumer-grid-wrapper">
<BaseCarousel v-if="smallScreen" :items="consumerIds">
<template #item="{ item }">
<ConsumerCard :consumer-id="item" full-height />
</template>
</BaseCarousel>

<div v-else class="consumer-grid-wrapper">
<div class="consumer-grid">
<ConsumerCard
v-for="item in consumerIds"
Expand All @@ -13,13 +19,19 @@

<script setup lang="ts">
import { computed } from 'vue';
import { useQuasar } from 'quasar';
import { useMqttStore } from 'src/stores/mqtt-store';

import BaseCarousel from 'src/components/BaseCarousel.vue';
import ConsumerCard from 'src/components/ConsumerCard.vue';

const $q = useQuasar();

const mqttStore = useMqttStore();

const consumerIds = computed(() => mqttStore.consumerIds);

const smallScreen = computed(() => $q.screen.width < 700);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In allen anderen Komponenten wird smallScreen so definiert:
const isSmallScreen = computed(() => Screen.lt.sm);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, das stimmt. Quasar definiert Screen.lt.sm bei 680 px. Wenn ich den Breakpoint bei 680 px lasse, werden die Karten in diesem Bereich zwar bereits untereinander dargestellt, aber noch nicht im Carousel. Bei 700 px erfolgt der Wechsel von der Reihenansicht zur Carousel-Ansicht sauber. Sonst sieht es so aus:

Bildschirmfoto vom 2026-07-16 09-14-26 Bildschirmfoto vom 2026-07-16 09-14-54

</script>

<style scoped lang="scss">
Expand Down
Loading