<template>
<uni-shadow-root class="vant-collapse-index"><view :class="'custom-class van-collapse '+(border ? 'van-hairline--top-bottom' : '')">
  <slot></slot>
</view></uni-shadow-root>
</template>

<script>

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

Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require('./../common/component.js');
component_1.VantComponent({
    relation: {
        name: 'collapse-item',
        type: 'descendant',
        linked: function linked(child) {
            this.children.push(child);
        },
        unlinked: function unlinked(child) {
            this.children = this.children.filter(function (item) {
                return item !== child;
            });
        }
    },
    props: {
        value: {
            type: null,
            observer: 'updateExpanded'
        },
        accordion: {
            type: Boolean,
            observer: 'updateExpanded'
        },
        border: {
            type: Boolean,
            value: true
        }
    },
    beforeCreate: function beforeCreate() {
        this.children = [];
    },
    methods: {
        updateExpanded: function updateExpanded() {
            this.children.forEach(function (child) {
                child.updateExpanded();
            });
        },
        switch: function _switch(name, expanded) {
            var _a = this.data,
                accordion = _a.accordion,
                value = _a.value;
            if (!accordion) {
                name = expanded ? (value || []).concat(name) : (value || []).filter(function (activeName) {
                    return activeName !== name;
                });
            } else {
                name = expanded ? name : '';
            }
            this.$emit('change', name);
            this.$emit('input', name);
        }
    }
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbIk9iamVjdCIsInZhbHVlIiwiY29tcG9uZW50XzEiLCJyZXF1aXJlIiwicmVsYXRpb24iLCJuYW1lIiwidHlwZSIsImxpbmtlZCIsInVubGlua2VkIiwiaXRlbSIsInByb3BzIiwib2JzZXJ2ZXIiLCJhY2NvcmRpb24iLCJib3JkZXIiLCJiZWZvcmVDcmVhdGUiLCJtZXRob2RzIiwidXBkYXRlRXhwYW5kZWQiLCJjaGlsZCIsInN3aXRjaCIsIl9hIiwiZXhwYW5kZWQiLCJhY3RpdmVOYW1lIl0sIm1hcHBpbmdzIjoiOztBQUNBQSxPQUFBQSxjQUFBQSx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k7XG4gICAgICAgIH0sXG4gICAgICAgIHVubGlua2VkOiBmdW5jdGlvbiAoY2hpbGQpIHtcbiAgICAgICAgICAgIHRoaXMuY2hpbGRyZW4gPSB0aGlzLmNoaWxkcmVuLmZpbHRlcihmdW5jdGlvbiAoaXRlbSkgeyByZXR1cm4gaXRlbSAhPT0gY2hpbGQ7IH0pO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBwcm9wczoge1xuICAgICAgICB2YWx1ZToge1xuICAgICAgICAgICAgdHlwZTogbnVsbCxcbiAgICAgICAgICAgIG9ic2VydmVyOiAndXBkYXRlRXhwYW5kZWQnXG4gICAgICAgIH0sXG4gICAgICAgIGFjY29yZGlvbjoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAgIG9ic2VydmVyOiAndXBkYXRlRXhwYW5kZWQnXG4gICAgICAgIH0sXG4gICAgICAgIGJvcmRlcjoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAgIHZhbHVlOiB0cnVlXG4gICAgICAgIH1cbiAgICB9LFxuICAgIGJlZm9yZUNyZWF0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmNoaWxkcmVuID0gW107XG4gICAgfSxcbiAgICBtZXRob2RzOiB7XG4gICAgICAgIHVwZGF0ZUV4cGFuZGVkOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLmNoaWxkcmVuLmZvckVhY2goZnVuY3Rpb24gKGNoaWxkKSB7XG4gICAgICAgICAgICAgICAgY2hpbGQudXBkYXRlRXhwYW5kZWQoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBzd2l0Y2g6IGZ1bmN0aW9uIChuYW1lLCBleHBhbmRlZCkge1xuICAgICAgICAgICAgdmFyIF9hID0gdGhpcy5kYXRhLCBhY2NvcmRpb24gPSBfYS5hY2NvcmRpb24sIHZhbHVlID0gX2EudmFsdWU7XG4gICAgICAgICAgICBpZiAoIWFjY29yZGlvbikge1xuICAgICAgICAgICAgICAgIG5hbWUgPSBleHBhbmRlZFxuICAgICAgICAgICAgICAgICAgICA/ICh2YWx1ZSB8fCBbXSkuY29uY2F0KG5hbWUpXG4gICAgICAgICAgICAgICAgICAgIDogKHZhbHVlIHx8IFtdKS5maWx0ZXIoZnVuY3Rpb24gKGFjdGl2ZU5hbWUpIHsgcmV0dXJuIGFjdGl2ZU5hbWUgIT09IG5hbWU7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbmFtZSA9IGV4cGFuZGVkID8gbmFtZSA6ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kZW1pdCgnY2hhbmdlJywgbmFtZSk7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCdpbnB1dCcsIG5hbWUpO1xuICAgICAgICB9XG4gICAgfVxufSk7XG4iXSwiZmlsZSI6ImluZGV4LmpzIn0=
export default global['__wxComponents']['vant/collapse/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';
</style>