<template>
  <commonStyle btnTitle="薪资待遇">
    <v-list>
      <v-list-item
        color="primary"
        :active="selectedItems.includes(item.value)"
        v-for="item in items" :key="item.id" :value="item.value"
        @click="handle(item.value)"
      >
        <v-list-item-title>{{ item.label }}</v-list-item-title>
      </v-list-item>
    </v-list>
  </commonStyle>
</template>
<script setup>
import commonStyle from './commonStyle.vue'
import { getDict } from '@/hooks/web/useDictionaries'
import { ref, defineEmits } from 'vue';

defineOptions({name: 'conditionFilter-payScope'})
const emits = defineEmits(['selectedItems'])
let items = ref()
let selectedItems = ref([])
getDict('menduner_pay_scope').then(({ data }) => {
  data = data?.length && data || []
  items.value = data
})
const handle = (val) => {
  // 单选
  selectedItems.value = [val]
  emits('selectedItems', selectedItems.value)
}
</script>
<style lang="scss" scoped>
</style>
