import { computed, defineComponent, reactive, ref, } from 'vue'; import { SbMain, IBlockData, SbMode } from '@schlechtenburg/core'; import SbLayout from '@schlechtenburg/layout'; import SbHeading from '@schlechtenburg/heading'; import SbParagraph from '@schlechtenburg/paragraph'; import SbImage from '@schlechtenburg/image'; import exampleData from './example-data'; import './ExampleEditor.scss'; export default defineComponent({ name: 'ExampleEditor', setup() { const activeTab = ref('edit'); const block: IBlockData = reactive({ ...exampleData }); const dateID = +(new Date()); const displayedElement = computed(() => { switch (activeTab.value) { case 'data': return
{ JSON.stringify(block, null, 2) }
; default: return ) => { block.id = data.id; block.name = data.name; block.data = data.data; }} />; } }); const onModeChange = ($event: Event) => { activeTab.value = ($event.target as HTMLSelectElement).value; }; return () => { return
{displayedElement.value}
; }; }, });