schlechtenburg/src/components/internal/BlockPlaceholder.tsx

32 lines
722 B
TypeScript
Raw Normal View History

2020-05-20 14:21:08 +00:00
import { defineComponent } from '@vue/composition-api';
import './BlockPlaceholder.scss';
export default defineComponent({
name: 'sb-block-placeholder',
render() {
return (
<div class="sb-block-placeholder">
<button
class="sb-block-placeholder__add"
type="button"
{...{
on: {
2020-05-24 15:33:25 +00:00
click: () => this.$emit('insert-block', {
name: 'sb-paragraph',
blockId: +(new Date()),
data: {
value: '',
},
2020-05-20 14:21:08 +00:00
}),
},
}}
>
{this.$slots.default ? this.$slots.default : 'Add a block'}
</button>
</div>
);
},
});