<template>
    <div class="iconBox" v-if="iconType">
        <i v-if="iconType=='iconfont'" :class="'icon iconfont '+(item.iconClass||'icon-dealt')"></i>
        <img v-else-if="iconType=='img'" :src="review+'?relativePath='+item.iconClass"  width="20" height="20"/>
    </div>
</template>
<script>
export default {
    props:{
        item:{
            type:Object
        }
    },
    components:{
        
    },
    data(){
        return {
            review:window.HIVUI_SETTING.review,
            iconType:"",
        };
    },
    computed:{
        
    },
    watch:{ 
        
    },
    mounted(){
        let me=this;
        if(me.item.type!='dir'&&!me.item.children){
            if(me.item.iconClass){
                if(me.item.iconClass.indexOf('.png')==-1 && me.item.iconClass.indexOf('.jpg')==-1){
                    me.iconType="iconfont";
                }else{
                    me.iconType="img";
                }
            }else{
                me.iconType="iconfont";
            }
        }
    },
    methods:{ 
        
    }
}
</script>
<style lang="less" scoped>
    .iconBox{
        display:flex;
        align-items: center;
        margin-right:5px;
    }
</style>