<template>
    <div :class="['app-rawitem-image', model.sysCss]" :style="containerStyle">
        <img v-if="imgUrl" :src="imgUrl" />
        <i v-else :class="imageClass ? imageClass : ''"></i>
    </div>
</template>
<script lang = 'ts'>
import { PanelFieldModel } from '@/model/panel-detail';
import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator';
@Component({})
export default class AppRawItemImage extends Vue {
    /**
     * 名称
     *
     * @type {*}
     * @memberof AppRawItemImage
     */
     @Prop() public name!: string;

    /**
     * 模型
     *
     * @type {*}
     * @memberof AppRawItemImage
     */
    @Prop() public layoutModelDetails!: any;

    /**
     * 图片地址
     *
     * @type {string}
     * @memberof AppRawItemImage
     */
    @Prop() public imgUrl?: string;

    /**
     * 图标
     *
     * @type {string}
     * @memberof AppRawItemImage
     */
    @Prop() public imageClass?: string;

    /**
     * 容器样式
     *
     * @type {any}
     * @memberof AppRawItemImage
     */
    public containerStyle: any = null;

    /**
     * 容器样式
     *
     * @type {any}
     * @memberof AppRawItemImage
     */
     public model: any = null;



    created() {
        if (this.layoutModelDetails && this.name) {
            this.model = this.layoutModelDetails[this.name];
            this.containerStyle = this.model.getElementStyle();
        }
    }

}
</script>
<style lang = "less">
@import './app-rawitem-image.less';
</style>