<template>
  <div class="statusControl" :style="statusStyle">
    <ul>
      <li
        v-for="(item, index) in list"
        :key="index"
        :class="{ acitive: value === item.key }"
        @click="onStatusChange(item.key)"
      >
        {{ item.value }}
      </li>
    </ul>
  </div>
</template>

<script>
// #144683
export default {
  name: "statusControl",
  props: {
    list: {
      type: Array,
      default: function () {
        return [];
      },
    },
    statusStyle: {
      type: [Object, String],
      default: "",
    },
    value: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    onStatusChange(key) {
      this.$emit("input", key);
    },
  },
};
</script>

<style scoped lang="less">
.statusControl {
  ul li {
    margin-bottom: 10px;
    border-radius: 5px;
    padding: 5px 10px;
    width: 150px;
    background-color: #fff;
    box-shadow: 0 0 5px #fff9;
    text-align: center;
    cursor: pointer;
    &.acitive {
      color: #fff;
      background-color: #144683;
    }
  }
}
</style>
