mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-24 17:20:21 +08:00
fix(editor): 没有页面时隐藏属性面板
This commit is contained in:
parent
9de04ddaa4
commit
91e4680024
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div ref="el" class="m-editor-layout">
|
||||
<template v-if="hasLeft">
|
||||
<template v-if="hasLeft && $slots.left">
|
||||
<div class="m-editor-layout-left" :class="leftClass" :style="`width: ${left}px`">
|
||||
<slot name="left"></slot>
|
||||
</div>
|
||||
@ -11,7 +11,7 @@
|
||||
<slot name="center"></slot>
|
||||
</div>
|
||||
|
||||
<template v-if="hasRight">
|
||||
<template v-if="hasRight && $slots.right">
|
||||
<Resizer @change="changeRight"></Resizer>
|
||||
<div class="m-editor-layout-right" :class="rightClass" :style="`width: ${right}px`">
|
||||
<slot name="right"></slot>
|
||||
|
@ -33,7 +33,7 @@
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<template v-if="pageLength > 0 && nodes.length === 1" #right>
|
||||
<template v-if="pageLength > 0" #right>
|
||||
<TMagicScrollbar>
|
||||
<slot name="props-panel"></slot>
|
||||
</TMagicScrollbar>
|
||||
@ -68,7 +68,6 @@ const codeOptions = inject('codeOptions', {});
|
||||
const { editorService, uiService } = inject<Services>('services') || {};
|
||||
|
||||
const root = computed(() => editorService?.get('root'));
|
||||
const nodes = computed(() => editorService?.get('nodes') || []);
|
||||
|
||||
const pageLength = computed(() => editorService?.get('pageLength') || 0);
|
||||
const showSrc = computed(() => uiService?.get('showSrc'));
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="m-editor-props-panel">
|
||||
<div class="m-editor-props-panel" v-if="nodes.length === 1">
|
||||
<slot name="props-panel-header"></slot>
|
||||
<MForm
|
||||
ref="configForm"
|
||||
@ -35,6 +35,7 @@ const configForm = ref<InstanceType<typeof MForm>>();
|
||||
const curFormConfig = ref<any>([]);
|
||||
const services = inject<Services>('services');
|
||||
const node = computed(() => services?.editorService.get('node'));
|
||||
const nodes = computed(() => services?.editorService.get('nodes') || []);
|
||||
const propsPanelSize = computed(() => services?.uiService.get('propsPanelSize') || 'small');
|
||||
const stage = computed(() => services?.editorService.get('stage'));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user