/** * API 文档 * props default 说明 * src - 图片地址 * width - 图片宽度 * height - 图片高度 * resize stretch 图片填充方式 * full false 点击之后是否全屏展示 */ import { Component, ComponentProps, Event } from 'waft'; import { lodash } from 'waft-ui-common'; import {JSONObject} from "waft-json"; export class Image extends Component { constructor(props: ComponentProps) { super(props); } handleImg(e: Event): void{ let full = lodash.toBoolean(this.props.get('full')); if (full) { const state = new JSONObject(); state.set('showFull', true); this.setState(state); } } closeImg(e: Event): void{ const state = new JSONObject(); state.set('showFull', false); this.setState(state); } }