<template>
  <van-cell class="checkbox-action-container" title="设为排它项" :border="false">
    <template #right-icon>
      <van-switch
        :model-value="localActiveOption"
        class="option-action-sheet-switch"
        size="0.5rem"
        :active-value="1"
        :inactive-value="0"
        @update:model-value="updateIsRemoveOther"
      ></van-switch>
    </template>
  </van-cell>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
  modelValue: {
    type: Number,
    default: 0
  }
});
const emit = defineEmits(['update:modelValue']);

const localActiveOption = computed({
  get() {
    return props.modelValue;
  },
  set(newValue) {
    emit('update:modelValue', newValue);
  }
});

const updateIsRemoveOther = (newValue) => {
  emit('update:modelValue', newValue);
};
</script>
<style scoped lang="scss"></style>
