schlechtenburg/src/App.tsx

40 lines
705 B
TypeScript
Raw Normal View History

2020-05-20 14:21:08 +00:00
import {
defineComponent,
reactive,
watchEffect,
} from '@vue/composition-api';
import Schlechtenburg from '@components/Schlechtenburg';
import './App.scss';
export default defineComponent({
name: 'App',
setup() {
2020-05-20 17:12:51 +00:00
const block = reactive({
2020-05-24 15:33:25 +00:00
name: 'sb-layout',
blockId: `${+(new Date())}`,
data: {
orientation: 'vertical',
children: [],
},
2020-05-20 14:21:08 +00:00
});
watchEffect(() => {
2020-05-24 15:33:25 +00:00
console.log('base block update', block);
2020-05-20 14:21:08 +00:00
});
2020-05-20 17:12:51 +00:00
return { block };
2020-05-20 14:21:08 +00:00
},
render() {
return (
<div id="app">
2020-05-20 17:12:51 +00:00
<Schlechtenburg vModel={this.block} />
2020-05-20 14:21:08 +00:00
2020-05-20 17:12:51 +00:00
<pre><code>{JSON.stringify(this.block, null, 2)}</code></pre>
2020-05-20 14:21:08 +00:00
</div>
);
},
});