Transition added
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { toRefs, reactive, watch, ref, computed } from 'vue';
|
import { toRefs, reactive, computed } from 'vue';
|
||||||
|
|
||||||
const layoutConfig = reactive({
|
const layoutConfig = reactive({
|
||||||
ripple: false,
|
ripple: false,
|
||||||
|
|||||||
@@ -16,17 +16,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, watch, ref, onMounted } from 'vue';
|
import { computed, watch, ref } from 'vue';
|
||||||
import AppTopbar from './AppTopbar.vue';
|
import AppTopbar from './AppTopbar.vue';
|
||||||
import AppFooter from './AppFooter.vue';
|
import AppFooter from './AppFooter.vue';
|
||||||
import AppSidebar from './AppSidebar.vue';
|
import AppSidebar from './AppSidebar.vue';
|
||||||
import AppConfig from './AppConfig.vue';
|
import AppConfig from './AppConfig.vue';
|
||||||
import { useLayoutService } from '@/composables/layoutService';
|
import { useLayoutService } from '@/composables/layoutService';
|
||||||
|
|
||||||
const { onMenuToggle, layoutConfig, layoutState, isSidebarActive } = useLayoutService();
|
const { layoutConfig, layoutState, isSidebarActive } = useLayoutService();
|
||||||
|
|
||||||
const outsideClickListener = ref(null);
|
const outsideClickListener = ref(null);
|
||||||
const sidebarActive = ref(false);
|
|
||||||
|
|
||||||
watch(isSidebarActive, (newVal) => {
|
watch(isSidebarActive, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
|
|||||||
@@ -32,9 +32,11 @@ defineProps({
|
|||||||
<span class="layout-menuitem-text">{{ item.label }}</span>
|
<span class="layout-menuitem-text">{{ item.label }}</span>
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
||||||
</a>
|
</a>
|
||||||
<ul v-if="item.items && item.visible !== false">
|
<Transition class="layout-submenu">
|
||||||
<app-menu-item v-for="(child, i) in item.items" :key="child" :index="i" :item="child" :root="false"></app-menu-item>
|
<ul v-if="item.items && item.visible !== false">
|
||||||
</ul>
|
<app-menu-item v-for="(child, i) in item.items" :key="child" :index="i" :item="child" :root="false"></app-menu-item>
|
||||||
|
</ul>
|
||||||
|
</Transition>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user