Fix module / collections list

This commit is contained in:
rijkvanzanten
2020-09-14 18:05:45 -04:00
parent eae2c5ba39
commit f63da70257
8 changed files with 49 additions and 34 deletions

View File

@@ -1,8 +1,8 @@
<template>
<div class="v-detail" :class="{ _active }">
<div class="v-detail" :class="{ disabled }">
<v-divider @click.native="_active = !_active">
<v-icon v-if="!disabled" :name="_active ? 'unfold_less' : 'unfold_more'" small />
<slot name="title">{{ label }}</slot>
<v-icon :name="_active ? 'unfold_less' : 'unfold_more'" small />
</v-divider>
<transition-expand>
<div v-if="_active">
@@ -31,10 +31,18 @@ export default defineComponent({
type: String,
default: i18n.t('toggle'),
},
startOpen: {
type: Boolean,
default: false,
},
disabled: {
type: Boolean,
default: false,
}
},
setup(props, { emit }) {
const localActive = ref(false);
const localActive = ref(props.startOpen);
const _active = computed({
get() {
if (props.active !== undefined) {
@@ -57,13 +65,14 @@ export default defineComponent({
.v-divider {
margin-bottom: 12px;
cursor: pointer;
}
&:hover {
--v-divider-label-color: var(--foreground-normal);
}
.v-detail:not(.disabled) .v-divider:hover {
--v-divider-label-color: var(--foreground-normal);
cursor: pointer;
}
.v-icon {
margin-left: 4px;
margin-right: 4px;
}
</style>