<template>
  <div>
    <v-btn-toggle v-model="text" tile color="primary" group mandatory >
      <v-btn value="changeY">
        表头配置 ( {{ list.length < 1 ? 0 : chosen.length }}/{{ list.length }} )
      </v-btn>
      <!-- 全选设置 -->
    </v-btn-toggle>
    <v-divider></v-divider>
    <div class="box py-3">
      <div v-show="text === 'changeY'" style="height: calc(100vh - 204px); overflow-y: auto;">
        <v-list-item-group v-model="chosen" mandatory multiple @change="handleChange">
          <v-list-item v-for="item in list" :key="item.value">
            <template v-slot:default="{ active }">
              <v-list-item-action>
                <v-checkbox :input-value="active" readonly></v-checkbox>
              </v-list-item-action>

              <v-list-item-content>
                <v-list-item-title>{{ item.text }}</v-list-item-title>
              </v-list-item-content>
            </template>
          </v-list-item>
        </v-list-item-group>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'general-settings',
  components: {},
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      chosen: [0], // mandatory-强制始终选择一个值
      text: 'changeY'
    }
  },
  computed: {
  },
  created () {
  },
  methods: {
    handleChange (val) {
      this.$emit('change', this.chosen)
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
