mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
437 B
18 lines
437 B
1 year ago
|
<script lang="ts" setup>
|
||
|
const props = defineProps<{ checked: boolean; disabled?: boolean }>()
|
||
|
|
||
|
const emit = defineEmits(['change', 'update:checked'])
|
||
|
|
||
|
const checked = useVModel(props, 'checked', emit)
|
||
|
|
||
|
const onChange = (e: boolean) => {
|
||
|
emit('change', e)
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<a-switch v-model:checked="checked" :disabled="props.disabled" class="nc-switch" size="small" @change="onChange">
|
||
|
<slot />
|
||
|
</a-switch>
|
||
|
</template>
|