<view class="collapse">
    <!-- header -->
    <view class="collapse-header" bind:tap="toggle">
        <view class="title">
            <view class="title-text" style="{{ titleStyle }}">
                {{ title }}
            </view>
        </view>
        <view class="arrow {{ open ? 'open' : '' }}">▼</view>
    </view>

    <view class="collapse-content" style="max-height: {{ open ? (contentHeight+offsetHeight) + 'px' : '0rpx' }}">
        <view class="content-inner" id="content">
            <slot />
        </view>
    </view>
</view>