diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-03-21 01:36:24 +0100 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-04-06 21:10:08 +0200 |
| commit | 902c660a10e654ebc96e40cfab7d09d36b7a77ac (patch) | |
| tree | c1319ce83b8fec7a6e8df37d160bc1ae1b981c95 /data/vue/Section.vue | |
| parent | 9f7e70904e6c0fa650323ac5e50ebf6003da333c (diff) | |
Adds data server
Diffstat (limited to 'data/vue/Section.vue')
| -rw-r--r-- | data/vue/Section.vue | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/data/vue/Section.vue b/data/vue/Section.vue new file mode 100644 index 0000000..f0202c0 --- /dev/null +++ b/data/vue/Section.vue @@ -0,0 +1,47 @@ +<template> + <h2 class="section_header" @click="section_toggle_visible"> + {{ name }} <span class="section_button">{{ visible ? '-' : '+' }}</span> + </h2> + <div :class="{ section_grid: grid }" v-if="visible"> + <slot></slot> + </div> +</template> + +<script setup> +import { defineProps, inject, ref } from 'vue' + +const props = defineProps({ name: String, grid: Boolean, visible: Boolean, triggers_reload: Boolean }) +const visible = ref(props.visible) +const trigger_reload = inject('trigger_reload') + +const section_toggle_visible = () => { + visible.value = !visible.value + if (props.triggers_reload) trigger_reload() +} + +defineExpose({ visible }) +</script> + +<style> +.section_header { + border-bottom: 1px solid #586e75; + cursor: pointer; + font-size: 18px; + font-weight: normal; +} + +.section_button { + font-family: monospace; +} + +.section_grid { + display: grid; + grid-template-columns: 1fr 1fr; +} + +@media screen and (max-width: 800px) { + .section_grid { + grid-template-columns: 1fr; + } +} +</style> |
