schlechtenburg/packages/core/lib/components/BlockMissing/display.tsx

42 lines
917 B
TypeScript
Raw Normal View History

2020-12-30 20:17:34 +00:00
import { defineComponent, PropType } from 'vue';
import {
model,
blockProps,
BlockProps,
} from '../../blocks';
import './style.scss';
interface MissingBlockProps extends BlockProps<any> {
eventUpdate: (b?: any) => void;
eventAppendBlock: (b?: any) => void;
eventRemoveBlock: () => void;
}
export default defineComponent({
name: 'sb-missing-block',
model,
props: {
name: String,
...blockProps,
data: {
type: (null as unknown) as PropType<any>,
default: null,
},
eventUpdate: { type: Function, default: () => {} },
eventAppendBlock: { type: Function, default: () => {} },
eventRemoveBlock: { type: Function, default: () => {} },
},
setup(props: MissingBlockProps) {
console.log(props, props.name, props.data, props.blockId);
return () => (
<div class="sb-missing-block">
Missing block: {props.name}
</div>
);
},
});