<template>
    <view
        :class="'custom-class ' + classPrefix + ' ' + (isImageName ? 'van-icon--image' : classPrefix + '-' + name)"
        :style="'color: ' + color + ';font-size: ' + utils.addUnit(size) + ';' + customStyle"
        @tap="onClick"
    >
        <van-info v-if="info !== null || dot" :dot="dot" :info="info" custom-class="van-icon__info" />
        <image v-if="isImageName" :src="name" mode="aspectFit" class="van-icon__image" />
    </view>
</template>
<script module="utils" lang="wxs" src="@/miniprogram_npm/@vant/weapp/wxs/utils.wxs"></script>
<script>
'use strict';
Object.defineProperty(exports, '__esModule', {
    value: true
});
var component_1 = require('../common/component');
component_1.VantComponent({
    props: {
        dot: Boolean,
        info: null,
        size: null,
        color: String,
        customStyle: String,
        classPrefix: {
            type: String,
            value: 'van-icon'
        },
        name: {
            type: String,
            observer: function (val) {
                this.setData({
                    isImageName: val.indexOf('/') !== -1
                });
            }
        }
    },
    methods: {
        onClick: function () {
            this.$emit('click');
        }
    }
});
</script>
<style>
@import './index.css';
</style>
