ant design vue switch 属性 动态赋值
<template><div><a-switchdefault-checked:autoFocus="false":checked="checked"checkedChildren='选中':loading="loading"size="small"unCheckedChildren="取消"@change="onChange">&.
·
<template>
<div>
<a-switch
default-checked
:autoFocus="false"
:checked="checked"
checkedChildren='选中'
:loading="loading"
size="small"
unCheckedChildren="取消"
@change="onChange"
>
</a-switch>
</div>
</template>
<script>
export default {
data() {
return {
checked:true,
loading:false
};
},
methods: {
onChange(checked) {
this.checked=checked;
console.log(`a-switch to ${checked}`);
},
},
};
</script>
更多推荐
已为社区贡献1条内容
所有评论(0)