mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 08:32:14 +00:00
added prettier
This commit is contained in:
@@ -1,55 +1,48 @@
|
||||
<template>
|
||||
<div class="ml-6 mb-6" :class="{'is-collapsed': ! isVisible, 'collapsable': canCollapse}">
|
||||
<div @click="hideGroup" class="flex items-center justify-between mb-2">
|
||||
<small class="text-xs font-bold dark:text-gray-700 text-gray-400">
|
||||
{{ title }}
|
||||
</small>
|
||||
<chevron-up-icon v-if="canCollapseWrapper" size="12" class="mr-5 cursor-pointer vue-feather text-gray-300 transform" :class="{'rotate-180': ! isVisible}" />
|
||||
<div class="ml-6 mb-6" :class="{ 'is-collapsed': !isVisible, collapsable: canCollapse }">
|
||||
<div @click="hideGroup" class="mb-2 flex items-center justify-between">
|
||||
<small class="text-xs font-bold text-gray-400 dark:text-gray-700">
|
||||
{{ title }}
|
||||
</small>
|
||||
<chevron-up-icon v-if="canCollapseWrapper" size="12" class="vue-feather mr-5 transform cursor-pointer text-gray-300" :class="{ 'rotate-180': !isVisible }" />
|
||||
</div>
|
||||
|
||||
<slot v-if="isVisible" />
|
||||
<slot v-if="isVisible" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TextLabel from "../Others/TextLabel";
|
||||
import { ChevronUpIcon } from 'vue-feather-icons'
|
||||
import TextLabel from '../Others/TextLabel'
|
||||
import { ChevronUpIcon } from 'vue-feather-icons'
|
||||
|
||||
export default {
|
||||
name: 'ContentGroup',
|
||||
props: [
|
||||
'canCollapse',
|
||||
'title',
|
||||
'slug'
|
||||
],
|
||||
components: {
|
||||
ChevronUpIcon,
|
||||
TextLabel,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isVisible: true,
|
||||
canCollapseWrapper: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hideGroup() {
|
||||
if (! this.canCollapseWrapper)
|
||||
return
|
||||
|
||||
this.isVisible = !this.isVisible
|
||||
localStorage.setItem('panel-group-' + this.slug, this.isVisible)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
if (this.canCollapse) {
|
||||
|
||||
let savedVisibility = localStorage.getItem('panel-group-' + this.slug)
|
||||
|
||||
this.isVisible = savedVisibility ? !!JSON.parse(String(savedVisibility).toLowerCase()) : true
|
||||
this.canCollapseWrapper = true
|
||||
}
|
||||
export default {
|
||||
name: 'ContentGroup',
|
||||
props: ['canCollapse', 'title', 'slug'],
|
||||
components: {
|
||||
ChevronUpIcon,
|
||||
TextLabel,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isVisible: true,
|
||||
canCollapseWrapper: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hideGroup() {
|
||||
if (!this.canCollapseWrapper) return
|
||||
|
||||
this.isVisible = !this.isVisible
|
||||
localStorage.setItem('panel-group-' + this.slug, this.isVisible)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.canCollapse) {
|
||||
let savedVisibility = localStorage.getItem('panel-group-' + this.slug)
|
||||
|
||||
this.isVisible = savedVisibility ? !!JSON.parse(String(savedVisibility).toLowerCase()) : true
|
||||
this.canCollapseWrapper = true
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user