mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
chore: add trailingComma
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<van-checkbox v-model="checkbox3">
|
||||
{{ $t('customIcon') }}
|
||||
<template #icon="{ checked }">
|
||||
<img :src="checked ? activeIcon : inactiveIcon">
|
||||
<img :src="checked ? activeIcon : inactiveIcon" />
|
||||
</template>
|
||||
</van-checkbox>
|
||||
</demo-block>
|
||||
@@ -110,7 +110,7 @@ export default {
|
||||
toggleAll: '全选与反选',
|
||||
checkAll: '全选',
|
||||
inverse: '反选',
|
||||
disabledLabelClick: '禁用文本点击'
|
||||
disabledLabelClick: '禁用文本点击',
|
||||
},
|
||||
'en-US': {
|
||||
checkbox: 'Checkbox',
|
||||
@@ -124,8 +124,8 @@ export default {
|
||||
toggleAll: 'Toggle All',
|
||||
checkAll: 'Check All',
|
||||
inverse: 'Inverse',
|
||||
disabledLabelClick: 'Disable the click event of label'
|
||||
}
|
||||
disabledLabelClick: 'Disable the click event of label',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -139,14 +139,14 @@ export default {
|
||||
list: [
|
||||
'a',
|
||||
'b',
|
||||
'c'
|
||||
'c',
|
||||
],
|
||||
result: ['a', 'b'],
|
||||
result2: [],
|
||||
result3: [],
|
||||
checkAllResult: [],
|
||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
||||
};
|
||||
},
|
||||
|
||||
@@ -161,8 +161,8 @@ export default {
|
||||
|
||||
toggleAll() {
|
||||
this.$refs.group.toggleAll();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -7,7 +7,7 @@ export default createComponent({
|
||||
mixins: [CheckboxMixin({
|
||||
bem,
|
||||
role: 'checkbox',
|
||||
parent: 'vanCheckbox'
|
||||
parent: 'vanCheckbox',
|
||||
})],
|
||||
|
||||
computed: {
|
||||
@@ -22,14 +22,14 @@ export default createComponent({
|
||||
} else {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
value(val) {
|
||||
this.$emit('change', val);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -67,6 +67,6 @@ export default createComponent({
|
||||
parent.$emit('input', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@@ -20,8 +20,8 @@ test('switch checkbox', async () => {
|
||||
test('disabled', () => {
|
||||
const wrapper = mount(Checkbox, {
|
||||
propsData: {
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.find('.van-checkbox__icon').trigger('click');
|
||||
@@ -31,11 +31,11 @@ test('disabled', () => {
|
||||
test('label disabled', () => {
|
||||
const wrapper = mount(Checkbox, {
|
||||
scopedSlots: {
|
||||
default: () => 'Label'
|
||||
default: () => 'Label',
|
||||
},
|
||||
propsData: {
|
||||
labelDisabled: true
|
||||
}
|
||||
labelDisabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.find('.van-checkbox__label').trigger('click');
|
||||
@@ -54,9 +54,9 @@ test('checkbox group', async () => {
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
result: []
|
||||
result: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const icons = wrapper.findAll('.van-checkbox__icon');
|
||||
@@ -77,8 +77,8 @@ test('click event', () => {
|
||||
const onClick = jest.fn();
|
||||
const wrapper = mount(Checkbox, {
|
||||
listeners: {
|
||||
click: onClick
|
||||
}
|
||||
click: onClick,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -92,11 +92,11 @@ test('click event', () => {
|
||||
test('label-position prop', () => {
|
||||
const wrapper = mount(Checkbox, {
|
||||
scopedSlots: {
|
||||
default: () => 'Label'
|
||||
default: () => 'Label',
|
||||
},
|
||||
propsData: {
|
||||
labelPosition: 'left'
|
||||
}
|
||||
labelPosition: 'left',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -109,7 +109,7 @@ test('icon-size prop', () => {
|
||||
<van-checkbox>label</van-checkbox>
|
||||
<van-checkbox icon-size="5rem">label</van-checkbox>
|
||||
</van-checkbox-group>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -122,7 +122,7 @@ test('checked-color prop', () => {
|
||||
<van-checkbox name="a" :value="true">label</van-checkbox>
|
||||
<van-checkbox name="b" :value="true" checked-color="white">label</van-checkbox>
|
||||
</van-checkbox-group>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -140,9 +140,9 @@ test('bind-group prop', async () => {
|
||||
return {
|
||||
value: false,
|
||||
result: [],
|
||||
list: ['a', 'b', 'c']
|
||||
list: ['a', 'b', 'c'],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const icons = wrapper.findAll('.van-checkbox__icon');
|
||||
@@ -163,14 +163,14 @@ test('toggleAll method', async () => {
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
result: ['a']
|
||||
result: ['a'],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toggleAll(checked) {
|
||||
this.$refs.group.toggleAll(checked);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.vm.toggleAll();
|
||||
|
Reference in New Issue
Block a user