Skip to content

Commit a587695

Browse files
ShGKmemejo-
authored andcommitted
fix(NcAppContent): avoid double content mount
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
1 parent 9e225bb commit a587695

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/components/NcAppContent/NcAppContent.vue

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ export default {
9292
</docs>
9393

9494
<template>
95-
<main id="app-content-vue" class="app-content no-snapper" :class="{ 'app-content--has-list': hasList }">
95+
<main id="app-content-vue" class="app-content no-snapper" :class="{ 'app-content--has-list': !!$scopedSlots.list }">
9696
<h1 v-if="pageHeading" class="hidden-visually">
9797
{{ pageHeading }}
9898
</h1>
9999

100-
<template v-if="hasList">
100+
<template v-if="!!$scopedSlots.list">
101101
<!-- Mobile view does not allow resizeable panes -->
102102
<div
103103
v-if="isMobile || layout === 'no-split'"
@@ -145,7 +145,7 @@ export default {
145145
</div>
146146
</template>
147147
<!-- @slot Provide the main content to the app content -->
148-
<slot v-if="!hasList" />
148+
<slot v-if="!$scopedSlots.list" />
149149
</main>
150150
</template>
151151

@@ -309,8 +309,6 @@ export default {
309309
data() {
310310
return {
311311
contentHeight: 0,
312-
hasList: false,
313-
hasContent: false,
314312
swiping: {},
315313
listPaneSize: this.restorePaneConfig(),
316314
}
@@ -406,18 +404,13 @@ export default {
406404
},
407405
},
408406
409-
updated() {
410-
this.checkSlots()
411-
},
412-
413407
mounted() {
414408
if (this.allowSwipeNavigation && !this.disableSwipe) {
415409
this.swiping = useSwipe(this.$el, {
416410
onSwipeEnd: this.handleSwipe,
417411
})
418412
}
419413
420-
this.checkSlots()
421414
this.restorePaneConfig()
422415
},
423416
@@ -461,12 +454,6 @@ export default {
461454
logger.debug('AppContent pane config', { size: listPaneSize })
462455
},
463456
464-
// $slots is not reactive, we need to update this manually
465-
checkSlots() {
466-
this.hasList = !!this.$scopedSlots.list
467-
this.hasContent = !!this.$scopedSlots.default
468-
},
469-
470457
// browserStorage is not reactive, we need to update this manually
471458
restorePaneConfig() {
472459
const listPaneSize = parseInt(browserStorage.getItem(this.paneConfigID), 10)

0 commit comments

Comments
 (0)