mirror of https://github.com/ElemeFE/element
commit
511250765c
|
@ -108,38 +108,11 @@
|
|||
```
|
||||
:::
|
||||
|
||||
### 可切换值的多选框
|
||||
|
||||
多选框单独时,除了可以表示为是否选中的逻辑值以外,你还可以设定其选中和未选中所表示的值。
|
||||
|
||||
:::demo 使用`true-label`和`false-label`可以自定义选中时和未选中时的值,可以为`String`或`Number`类型。
|
||||
|
||||
```html
|
||||
<template>
|
||||
<el-checkbox
|
||||
v-model="isValid"
|
||||
true-label="可用"
|
||||
false-label="不可用">
|
||||
{{isValid}}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isValid: '可用'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
```
|
||||
:::
|
||||
|
||||
### Checkbox Attributes
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|---------- |-------- |---------- |------------- |-------- |
|
||||
| label | 选中状态的值(只有在`checkbox-group`下有意义) | string | — | — |
|
||||
| true-label | 选中时的值 | string, number | — | — |
|
||||
| label | 选中状态的值(只有在`checkbox-group`或者绑定对象类型为`array`时有效)| string | — | — |
|
||||
| true-label | 选中时的值 | string, number | — | — |
|
||||
| false-label | 没有选中时的值 | string, number | — | — |
|
||||
| disabled | 按钮禁用 | boolean | — | false |
|
||||
| checked | 当前是否勾选 | boolean | — | false |
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
| with-credentials | 支持发送 cookie 凭证信息 | boolean | — | false |
|
||||
| show-upload-list | 是否显示已上传文件列表 | boolean | — | true |
|
||||
| type | 上传控件类型 | string | select,drag | select |
|
||||
| accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), 拖拽文件上传时不受此参数影响 | string | — | — |
|
||||
| accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept)(thumbnail-mode 模式下此参数无效)| string | — | — |
|
||||
| on-preview | 可选参数, 点击已上传的文件链接时的钩子 | function(file) | — | — |
|
||||
| on-remove | 可选参数, 文件列表移除文件时的钩子 | function(file, fileList) | — | — |
|
||||
| on-success | 可选参数, 文件上传成功时的钩子 | function(file, fileList) | — | — |
|
||||
|
|
Loading…
Reference in New Issue