<template>
    <view>
        <s-tabs :list="list" @change="changeIndex" :current="value"></s-tabs>
        <view>
            <slot></slot>
        </view>
    </view>
</template>
<script>
import props from './prop.js'
export default {
    mixins: [props],
    name: 'm-tabs-container',
    provide() {
        return {
            active: this.obj
        }
    },
    data() {
        return {
           obj: { activeIndex: this.value }
        }
    },
    methods: {
        changeIndex({index}) {
            this.obj.activeIndex = index
            this.$emit("input", index)
        }
    }
}
</script>
