more generic Tips component
This commit is contained in:
parent
fd29b4ad2f
commit
4f2ecd14f4
1 changed files with 16 additions and 2 deletions
|
@ -2,7 +2,9 @@
|
|||
<ul class="tip">
|
||||
<header>
|
||||
Tips:
|
||||
<button @click="tipsShown = !tipsShown">{{ tipsShown ? 'close' : 'expand' }}</button>
|
||||
<button @click="tipsShown = !tipsShown" v-if="collapsible">
|
||||
{{ tipsShown ? 'collapse' : 'expand' }}
|
||||
</button>
|
||||
</header>
|
||||
<template v-if="tipsShown">
|
||||
<slot />
|
||||
|
@ -12,5 +14,17 @@
|
|||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const tipsShown = ref(true)
|
||||
|
||||
const props = defineProps({
|
||||
collapsible: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
hiddenByDefault: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const tipsShown = ref(!props.hiddenByDefault)
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue