diff --git a/docs/views/basic/table.vue b/docs/views/basic/table.vue index 7d0e340..cdd5e3a 100644 --- a/docs/views/basic/table.vue +++ b/docs/views/basic/table.vue @@ -1,14 +1,14 @@ @@ -365,7 +364,6 @@ export default { }], checkbox: { disabled: false, - checked: false, text: '' } }, { @@ -486,4 +484,4 @@ export default { } } } - \ No newline at end of file + diff --git a/docs/views/form/checkbox.vue b/docs/views/form/checkbox.vue index 2070b6a..b3d104b 100644 --- a/docs/views/form/checkbox.vue +++ b/docs/views/form/checkbox.vue @@ -12,7 +12,7 @@

- +

@@ -20,7 +20,7 @@ ### 代码 ```html - + ``` ```javascript @@ -28,11 +28,19 @@ export default { data () { return { checkbox: { - checked: false, + // checked: false, 默认不选中 text: "我已阅读用户协议" } } }, + methods: { + handleChange (checkbox, vm, e) { + this.$Modal.confirm( + '复选框', + `checkbox: ${checkbox.checked}` + ) + } + } components: { rdCheckbox } @@ -45,9 +53,10 @@ export default { | 参数 | 类型 | 说明 | | :------------- |:-------------|:------------| -| checked | Bolean | 选中状态 | +| checked | Bolean | 选中状态 | +| disabled | Bolean | 禁用状态 | | text | String | 文字 | - +| change | 事件 | 复选框改变事件 参数checkbox;vm;event | @@ -64,19 +73,27 @@ export default { data () { return { checkbox: { - checked: false, text: '我已阅读用户协议' }, + checked: false, checkA: { disabled: false, - checked: false, + checked: true, text: '同意服务条款' } } }, + methods: { + handleChange (checkbox, vm, e) { + this.$Modal.confirm( + '复选框', + `checkbox: ${checkbox.checked}` + ) + } + }, components: { rdCheckbox, Mark } } - \ No newline at end of file + diff --git a/src/components/basic/table.vue b/src/components/basic/table.vue index 6c17de2..aff5828 100644 --- a/src/components/basic/table.vue +++ b/src/components/basic/table.vue @@ -70,15 +70,15 @@ - {{col.value}} - @@ -94,7 +94,7 @@ - +
@@ -108,18 +108,18 @@ {{row.state.value}} - {{action.text}} - { - row.checkbox.checked = val - }) + if (val) { // 全选时才设置 + this.table.tableData.forEach(row => { + row.checkbox.checked = val + }) + } }, touchCol (e, col) { if (col.sort && col.sort.func) { col.sort.func(e, col) } + }, + handleChange (checkbox, vm, e) { + if (!checkbox.checked && this.selectAll.checked) this.selectAll.checked = false } } } - \ No newline at end of file + diff --git a/src/components/form/checkbox.vue b/src/components/form/checkbox.vue index 13f1e23..1a92860 100644 --- a/src/components/form/checkbox.vue +++ b/src/components/form/checkbox.vue @@ -51,9 +51,9 @@ }