schlechtenburg/src/components/user/Image/display.tsx

36 lines
586 B
TypeScript
Raw Normal View History

2020-05-27 15:32:35 +00:00
import { defineComponent, PropType } from '@vue/composition-api';
2020-05-27 15:06:14 +00:00
import {
model,
blockProps,
} from '@components/TreeElement';
import {
getDefaultData,
ImageData,
ImageProps,
} from './util';
import './style.scss';
export default defineComponent({
name: 'sb-image-display',
model,
props: {
...blockProps,
data: {
type: (null as unknown) as PropType<ImageData>,
default: getDefaultData,
},
},
2020-05-27 15:32:35 +00:00
setup(props: ImageProps) {
return () => <img
class="sb-image"
src={props.data.src}
alt={props.data.alt}
/>;
2020-05-27 15:06:14 +00:00
},
});