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.
ant-design-vue/components/switch/demo/disabled.vue

35 lines
559 B

<docs>
---
order: 1
title:
zh-CN: 不可用
en-US: Disabled
---
## zh-CN
Switch 失效状态
## en-US
Disabled state of `Switch`.
</docs>
<template>
<a-space direction="vertical">
<a-switch v-model:checked="checked" :disabled="disabled" />
<a-button type="primary" @click="onToggle">Toggle disabled</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
const checked = ref<boolean>(true);
const disabled = ref<boolean>(true);
const onToggle = () => {
disabled.value = !disabled.value;
};
</script>