<template>
  <CellGroup title="单选列表">
    <Cell :showMore="showMore" type="checkbox" v-for="(item, i) of list" :key="i">
      <div slot="left">{{item}}</div>
      <input slot="right" type="checkbox" :value="item" v-model="result" />
      <div slot="more" class="del">
        删除
      </div>
    </Cell>
    <div slot="foot">
      <Cell>
        <div slot="left">结果</div>
        <div slot="right">{{result}}</div>
      </Cell>
      <Cell @click.native="showMore = !showMore">
        <div slot="left">显示更多</div>
      </Cell>
    </div>
  </CellGroup>
</template>

<script lang="ts">
import Vue from 'vue'
import { CellGroup, Cell } from '../../tunas'

export default Vue.extend({
  data () {
    return {
      showMore: false,
      result: [],
      list: [
        '周日', '周一', '周二', '周三', '周四', '周五','周六'
      ]
    }
  },
  components: {
    CellGroup,
    Cell
  }
})
</script>

<style lang="stylus" scoped>
  .del {
    height 100%
    width 50px
    background #f00
    color #fff
    display flex
    justify-content center
    align-items center
  }
</style>
