1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* eslint no-console:0 */
import Checkbox from '../index';
import '../assets/index.less';
function onChange(e) {
console.log('Checkbox checked:', e.target.checked);
}
export default {
data: function data() {
return {
disabled: false
};
},
methods: {
toggle: function toggle() {
this.disabled = !this.disabled;
}
},
render: function render() {
var h = arguments[0];
return h(
'div',
{ style: { margin: '20px' } },
[h('div', [h('p', [h('label', [h(Checkbox, {
attrs: { checked: true, disabled: this.disabled },
on: {
'change': onChange
}
}), '\xA0 controlled checked rc-checkbox']), '\xA0\xA0']), h('p', [h('label', [h('input', {
attrs: { checked: true, type: 'checkbox', disabled: this.disabled },
on: {
'change': onChange
}
}), '\xA0 controlled checked native']), '\xA0\xA0'])]), h('div', [h('p', [h('label', [h(Checkbox, {
attrs: { defaultChecked: true, disabled: this.disabled },
on: {
'change': onChange
}
}), '\xA0 defaultChecked rc-checkbox']), '\xA0\xA0'])]), h('div', [h('p', [h('label', [h(Checkbox, {
attrs: {
name: 'my-checkbox',
defaultChecked: true,
disabled: this.disabled,
id: 'test'
},
on: {
'change': onChange
}
}), '\xA0 defaultChecked rc-checkbox with name']), '\xA0\xA0'])]), h(
'button',
{
on: {
'click': this.toggle
}
},
['toggle disabled']
)]
);
}
};