import { Icon } from 'ant-design-vue'

//引用iconfont
// const IconFont = Icon.createFromIconfontCN({
//   scriptUrl: '//at.alicdn.com/t/font_2436719_9uykm5wxqth.js'
// })
export default {
    name: 'PlgIcon',
    components: {
        // IconFont,
    },
    props:{
        type: {
            type: String,
            default: '',
            required: true
        },
        pstyle:{
            type:Object,
            default: ()=>{},
            required:false
        }
    },
    render(h){

        if(this.type && this.type.indexOf('iconfont')>-1){
            //return <icon-font type={this.type.substring(9)} class="iconfont_1" style={this.pstyle}></icon-font>
            return <i class={this.type} style={this.pstyle}></i>
        }else{
            return <a-icon type={this.type} style={this.pstyle} />
        }
    }
}
