<template>
<uni-shadow-root class="vant-badge-index"><view :class="(utils.bem('badge', { active }))+' van-hairline custom-class'" hover-class="van-badge--hover" hover-stay-time="70" @click="onClick">
  <view class="van-badge__text">
    <van-info v-if="info !== null" :info="info" custom-style="right: 4px"></van-info>
    {{ title }}
  </view>
</view></uni-shadow-root>
</template>
<wxs src="../wxs/utils.wxs" module="utils"></wxs>
<script>
import VanInfo from '../info/index.vue'
global['__wxVueOptions'] = {components:{'van-info': VanInfo}}

global['__wxRoute'] = 'vant/badge/index'
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require('./../common/component.js');
component_1.VantComponent({
    relation: {
        type: 'ancestor',
        name: 'badge-group',
        linked: function linked(target) {
            this.parent = target;
        }
    },
    props: {
        info: null,
        title: String
    },
    methods: {
        onClick: function onClick() {
            var _this = this;
            var parent = this.parent;
            if (!parent) {
                return;
            }
            var index = parent.badges.indexOf(this);
            parent.setActive(index).then(function () {
                _this.$emit('click', index);
                parent.$emit('change', index);
            });
        },
        setActive: function setActive(active) {
            return this.set({ active: active });
        }
    }
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbIk9iamVjdCIsInZhbHVlIiwiY29tcG9uZW50XzEiLCJyZXF1aXJlIiwicmVsYXRpb24iLCJ0eXBlIiwibmFtZSIsImxpbmtlZCIsInByb3BzIiwiaW5mbyIsInRpdGxlIiwiU3RyaW5nIiwibWV0aG9kcyIsIm9uQ2xpY2siLCJfdGhpcyIsInBhcmVudCIsImluZGV4Iiwic2V0QWN0aXZlIiwiYWN0aXZlIl0sIm1hcHBpbmdzIjoiOztBQUNBQSxPQUFBQSxjQUFBQSxDQUFBQSxPQUFBQSxFQUFBQSxZQUFBQSxFQUE2QyxFQUFFQyxPQUEvQ0QsSUFBNkMsRUFBN0NBO0FBQ0EsSUFBSUUsY0FBY0MsUUFBbEIsMEJBQWtCQSxDQUFsQjt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VxdWlyZShcIi4uL2NvbW1vbi9jb21wb25lbnRcIik7XG5jb21wb25lbnRfMS5WYW50Q29tcG9uZW50KHtcbiAgICByZWxhdGlvbjoge1xuICAgICAgICB0eXBlOiAnYW5jZXN0b3InLFxuICAgICAgICBuYW1lOiAnYmFkZ2UtZ3JvdXAnLFxuICAgICAgICBsaW5rZWQ6IGZ1bmN0aW9uICh0YXJnZXQpIHtcbiAgICAgICAgICAgIHRoaXMucGFyZW50ID0gdGFyZ2V0O1xuICAgICAgICB9XG4gICAgfSxcbiAgICBwcm9wczoge1xuICAgICAgICBpbmZvOiBudWxsLFxuICAgICAgICB0aXRsZTogU3RyaW5nXG4gICAgfSxcbiAgICBtZXRob2RzOiB7XG4gICAgICAgIG9uQ2xpY2s6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgcGFyZW50ID0gdGhpcy5wYXJlbnQ7XG4gICAgICAgICAgICBpZiAoIXBhcmVudCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBpbmRleCA9IHBhcmVudC5iYWRnZXMuaW5kZXhPZih0aGlzKTtcbiAgICAgICAgICAgIHBhcmVudC5zZXRBY3RpdmUoaW5kZXgpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLiRlbWl0KCdjbGljaycsIGluZGV4KTtcbiAgICAgICAgICAgICAgICBwYXJlbnQuJGVtaXQoJ2NoYW5nZScsIGluZGV4KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBzZXRBY3RpdmU6IGZ1bmN0aW9uIChhY3RpdmUpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnNldCh7IGFjdGl2ZTogYWN0aXZlIH0pO1xuICAgICAgICB9XG4gICAgfVxufSk7XG4iXSwiZmlsZSI6ImluZGV4LmpzIn0=
export default global['__wxComponents']['vant/badge/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';.van-badge{display:block;padding:20px 12px 20px 9px;overflow:hidden;font-size:14px;line-height:1.4;color:#7d7e80;word-break:break-all;background-color:#f8f8f8;border-left:3px solid transparent;box-sizing:border-box;-webkit-user-select:none;user-select:none}.van-badge--hover{background-color:#f2f3f5}.van-badge:after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active:after{border-right-width:1px}.van-badge--active,.van-badge--active.van-badge--hover{background-color:#fff}.van-badge__text{position:relative}
</style>