37 lines
888 B
Vue
37 lines
888 B
Vue
![]() |
<script setup lang="ts">
|
||
|
import { EditorService } from '@core/editor.service';
|
||
|
import { onMounted, provide, shallowRef } from 'vue';
|
||
|
|
||
|
const EDITOR_KEY = Symbol('editor-key');
|
||
|
|
||
|
type Props = {
|
||
|
id: string;
|
||
|
};
|
||
|
const props = defineProps<Props>();
|
||
|
|
||
|
const container = shallowRef<HTMLDivElement>();
|
||
|
const editor = shallowRef<EditorService>();
|
||
|
provide(EDITOR_KEY, editor);
|
||
|
onMounted(() => {
|
||
|
editor.value = new EditorService(container.value!);
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<a-layout class="full">
|
||
|
<a-layout-header>header</a-layout-header>
|
||
|
|
||
|
<a-layout>
|
||
|
<a-layout-sider>
|
||
|
<RobotList v-if="editor" :editor="EDITOR_KEY" />
|
||
|
</a-layout-sider>
|
||
|
<a-layout-content>
|
||
|
<div ref="container" class="full"></div>
|
||
|
</a-layout-content>
|
||
|
<a-layout-sider>sider</a-layout-sider>
|
||
|
</a-layout>
|
||
|
</a-layout>
|
||
|
</template>
|
||
|
|
||
|
<!-- <style scoped lang="scss"></style> -->
|