<script lang="ts" setup>
defineProps({
  name: { type: String, default: "status" },
  activeText: { type: String, default: "启用" },
  inactiveText: { type: String, default: "禁用" },
});
const statusValue = defineModel<number>({ default: 1 });
const emit = defineEmits<{ change: [val: any] }>();
</script>
<template>
  <el-switch
    :name="name"
    v-model="statusValue"
    :active-text="activeText"
    :inactive-text="inactiveText"
    :active-value="1"
    :inactive-value="0"
    @change="val => emit('change', val)"
    inline-prompt
  />
</template>
