<template>
  <div
    v-show="$parent.swiping || id === $parent.currentActive"
    class="co-tab-container-item">
    <slot></slot>
  </div>
</template>

<script>
/**
 * co-tab-container-item
 * @desc 搭配 tab-container 使用
 * @module components/tab-container-item
 *
 * @param {number|string} [id] - 该项的 id
 *
 * @example
 * <co-tab-container v-model="selected">
 *   <co-tab-container-item id="1"> 内容A </co-tab-container-item>
 *   <co-tab-container-item id="2"> 内容B </co-tab-container-item>
 *   <co-tab-container-item id="3"> 内容C </co-tab-container-item>
 * </co-tab-container>
 */
export default {
  name: 'co-tab-container-item',

  props: ['id']
};
</script>

<style>
  @component-namespace co {
    @component tab-container-item {
      flex-shrink: 0;
      width: 100%;
    }
  }
</style>
