mirror of
https://github.com/hoppscotch/hoppscotch
synced 2024-11-22 15:18:35 +00:00
48 lines
1.1 KiB
Vue
48 lines
1.1 KiB
Vue
<template>
|
|
<fieldset :id="label.toLowerCase()" :class="{ 'no-colored-frames': noFrameColors }">
|
|
<legend @click.prevent="collapse">{{ label }} ↕</legend>
|
|
<div class="collapsible" :class="{ hidden: collapsed }">
|
|
<slot />
|
|
</div>
|
|
</fieldset>
|
|
</template>
|
|
|
|
<style>
|
|
fieldset.no-colored-frames {
|
|
border-color: #afafaf !important;
|
|
}
|
|
|
|
fieldset.no-colored-frames legend {
|
|
color: var(--ac-color);
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
export default {
|
|
|
|
computed: {
|
|
noFrameColors () {
|
|
return this.$store.state.postwoman.settings.DISABLE_FRAME_COLORS || false;
|
|
}
|
|
},
|
|
|
|
props: {
|
|
"label": {
|
|
type: String,
|
|
default: "Section"
|
|
},
|
|
"collapsed": {
|
|
type: Boolean
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
collapse({ target }) {
|
|
const parent = target.parentNode;
|
|
parent.querySelector(".collapsible").classList.toggle('hidden');
|
|
},
|
|
}
|
|
|
|
}
|
|
</script>
|