Skip to content

Commit 4c526d2

Browse files
committed
refactor: update docs
1 parent 32b49d4 commit 4c526d2

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

src/radio/src/radio.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default {
9696
val = true;
9797
}
9898
if (this.isGroup) {
99-
this.dispatch('zaRadioGroup', 'input', [val]);
99+
this.dispatch('zaRadioGroup', 'input', val);
100100
} else {
101101
this.$emit('input', val);
102102
this.currentChecked = val;
@@ -144,7 +144,7 @@ export default {
144144
// first emit('input') to make the model up to date
145145
this.$nextTick(_ => { // eslint-disable-line no-unused-vars
146146
if (this.isGroup) {
147-
this.dispatch('zaRadioGroup', 'change', [[this.model], event]);
147+
this.dispatch('zaRadioGroup', 'change', [this.model, event]);
148148
} else {
149149
this.$emit('change', this.model, event);
150150
}

test/unit/specs/button.spec.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,32 @@ describe('Button', () => {
4747
expect(wrapper.contains('.za-button--block')).toBe(true);
4848
});
4949

50-
it('bordered', () => {
50+
it('ghost', () => {
5151
const wrapper = mount(zaButton, {
5252
propsData: {
53-
bordered: true,
53+
ghost: true,
5454
},
5555
});
5656
expect(wrapper.contains('.za-button--bordered')).toBe(true);
5757
});
5858

59-
it('active', () => {
60-
const wrapper = mount(zaButton, {
61-
propsData: {
62-
active: true,
63-
},
64-
});
65-
expect(wrapper.contains('.za-button--active')).toBe(true);
66-
});
59+
// it('active', () => {
60+
// const wrapper = mount(zaButton, {
61+
// propsData: {
62+
// active: true,
63+
// },
64+
// });
65+
// expect(wrapper.contains('.za-button--active')).toBe(true);
66+
// });
6767

68-
it('focus', () => {
69-
const wrapper = mount(zaButton, {
70-
propsData: {
71-
focus: true,
72-
},
73-
});
74-
expect(wrapper.contains('.za-button--focus')).toBe(true);
75-
});
68+
// it('focus', () => {
69+
// const wrapper = mount(zaButton, {
70+
// propsData: {
71+
// focus: true,
72+
// },
73+
// });
74+
// expect(wrapper.contains('.za-button--focus')).toBe(true);
75+
// });
7676

7777
it('disabled', () => {
7878
const wrapper = mount(zaButton, {

test/unit/specs/checkbox.spec.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Checkbox', () => {
6262
},
6363
template: `
6464
<za-checkbox-group v-model='checkboxGroup' @change='handleGroupChange'>
65-
<za-checkbox v-for='(city, index) in cities' :label="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
65+
<za-checkbox v-for='(city, index) in cities' :value="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
6666
</za-checkbox-group>
6767
`,
6868
data() {
@@ -89,7 +89,7 @@ describe('Checkbox', () => {
8989
},
9090
template: `
9191
<za-checkbox-group v-model='checkboxGroup' @change='handleGroupChange' shape='radius' type='button' theme='primary' block>
92-
<za-checkbox v-for='(city, index) in cities' :label="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
92+
<za-checkbox v-for='(city, index) in cities' :value="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
9393
</za-checkbox-group>
9494
`,
9595
data() {
@@ -118,7 +118,7 @@ describe('Checkbox', () => {
118118
},
119119
template: `
120120
<za-checkbox-group v-model='checkboxGroup' @change='handleGroupChange' shape='radius' type='cell'>
121-
<za-checkbox v-for='(city, index) in cities' :label="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
121+
<za-checkbox v-for='(city, index) in cities' :value="city" :key="city" :disabled='index === 2'>{{city}}</za-checkbox>
122122
</za-checkbox-group>
123123
`,
124124
data() {
@@ -154,7 +154,7 @@ describe('Checkbox', () => {
154154
},
155155
template: `
156156
<za-checkbox-group v-model='checkboxGroup'>
157-
<za-checkbox v-for='(city, i) in cities' :label="city" :key="city" :disabled='i === 2'>
157+
<za-checkbox v-for='(city, i) in cities' :value="city" :key="city" :disabled='i === 2'>
158158
{{city}}
159159
</za-checkbox>
160160
</za-checkbox-group>
@@ -218,8 +218,8 @@ describe('Checkbox', () => {
218218
},
219219
template: `
220220
<za-checkbox-group v-model='checkboxGroup'>
221-
<za-checkbox label="a" ref="a">a</za-checkbox>
222-
<za-checkbox label="b" ref="b">b</za-checkbox>
221+
<za-checkbox value="a" ref="a">a</za-checkbox>
222+
<za-checkbox value="b" ref="b">b</za-checkbox>
223223
</za-checkbox-group>
224224
`,
225225
data() {

test/unit/specs/radio.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('Radio', () => {
1212
},
1313
template: `
1414
<za-radio-group theme='primary' type='button' shape='radius' v-model='radio' ref='radio'>
15-
<za-radio ref='a' label='a'>a</za-radio>
16-
<za-radio ref='b' label='b'>a</za-radio>
17-
<za-radio ref='c' label='c'>a</za-radio>
15+
<za-radio ref='a' value='a'>a</za-radio>
16+
<za-radio ref='b' value='b'>a</za-radio>
17+
<za-radio ref='c' value='c'>a</za-radio>
1818
</za-radio-group>
1919
`,
2020
data() {
@@ -40,9 +40,9 @@ describe('Radio', () => {
4040
},
4141
template: `
4242
<za-radio-group theme='primary' type='button' disabled>
43-
<za-radio ref='a' label='a'>a</za-radio>
44-
<za-radio ref='b' label='b'>b</za-radio>
45-
<za-radio ref='c' label='c'>c</za-radio>
43+
<za-radio ref='a' value='a'>a</za-radio>
44+
<za-radio ref='b' value='b'>b</za-radio>
45+
<za-radio ref='c' value='c'>c</za-radio>
4646
</za-radio-group>
4747
`,
4848
};
@@ -59,9 +59,9 @@ describe('Radio', () => {
5959
},
6060
template: `
6161
<za-radio-group theme='primary' type='button' v-model='radio'>
62-
<za-radio ref='a' label='a'>a</za-radio>
63-
<za-radio ref='b' label='b'>b</za-radio>
64-
<za-radio ref='c' label='c'>c</za-radio>
62+
<za-radio ref='a' value='a'>a</za-radio>
63+
<za-radio ref='b' value='b'>b</za-radio>
64+
<za-radio ref='c' value='c'>c</za-radio>
6565
</za-radio-group>
6666
`,
6767
data() {
@@ -84,9 +84,9 @@ describe('Radio', () => {
8484
},
8585
template: `
8686
<za-radio-group theme='primary' type='button' v-model='radio' @change='handleChange'>
87-
<za-radio ref='a' label='a'>a</za-radio>
88-
<za-radio ref='b' label='b'>b</za-radio>
89-
<za-radio ref='c' label='c'>c</za-radio>
87+
<za-radio ref='a' value='a'>a</za-radio>
88+
<za-radio ref='b' value='b'>b</za-radio>
89+
<za-radio ref='c' value='c'>c</za-radio>
9090
</za-radio-group>
9191
`,
9292
methods: {

0 commit comments

Comments
 (0)