chore: add trailingComma

This commit is contained in:
陈嘉涵
2020-01-19 11:57:09 +08:00
parent e841175fe8
commit 389d68884d
269 changed files with 2706 additions and 2702 deletions
+7 -7
View File
@@ -46,7 +46,7 @@ export default {
withCell: '搭配单元格使用',
customSize: '自定义大小',
customColor: '自定义颜色',
asyncControl: '异步控制'
asyncControl: '异步控制',
},
'en-US': {
title: 'Title',
@@ -55,8 +55,8 @@ export default {
withCell: 'Inside a Cell',
customSize: 'Custom Size',
customColor: 'Custom Color',
asyncControl: 'Async Control'
}
asyncControl: 'Async Control',
},
},
data() {
@@ -66,7 +66,7 @@ export default {
checked3: true,
checked4: true,
checked5: true,
checked6: false
checked6: false,
};
},
@@ -75,13 +75,13 @@ export default {
this.$dialog
.confirm({
title: this.$t('title'),
message: this.$t('message')
message: this.$t('message'),
})
.then(() => {
this.checked4 = checked;
});
}
}
},
},
};
</script>
+3 -3
View File
@@ -28,14 +28,14 @@ function Switch(
activeColor,
activeValue,
inactiveColor,
inactiveValue
inactiveValue,
} = props;
const checked = value === activeValue;
const switchStyle = {
fontSize: addUnit(size),
backgroundColor: checked ? activeColor : inactiveColor
backgroundColor: checked ? activeColor : inactiveColor,
};
const loadingColor = checked ? activeColor || BLUE : inactiveColor || '';
@@ -55,7 +55,7 @@ function Switch(
class={bem({
on: checked,
loading,
disabled
disabled,
})}
role="switch"
style={switchStyle}
+3 -3
View File
@@ -22,10 +22,10 @@ export const switchProps = {
inactiveColor: String,
activeValue: {
type: null as any,
default: true
default: true,
},
inactiveValue: {
type: null as any,
default: false
}
default: false,
},
};
+18 -18
View File
@@ -8,9 +8,9 @@ test('emit event', () => {
context: {
on: {
input,
change
}
}
change,
},
},
});
wrapper.trigger('click');
@@ -25,12 +25,12 @@ test('disabled', () => {
context: {
on: {
input,
change
}
change,
},
},
propsData: {
disabled: true
}
disabled: true,
},
});
wrapper.trigger('click');
@@ -45,14 +45,14 @@ test('active-value & inactive-value prop', () => {
propsData: {
value: '1',
activeValue: '1',
inactiveValue: '2'
inactiveValue: '2',
},
context: {
on: {
input,
change
}
}
change,
},
},
});
wrapper.trigger('click');
@@ -66,8 +66,8 @@ test('inactive-color prop', () => {
propsData: {
value: '2',
inactiveValue: '2',
inactiveColor: 'black'
}
inactiveColor: 'black',
},
});
expect(wrapper).toMatchSnapshot();
@@ -76,8 +76,8 @@ test('inactive-color prop', () => {
test('size prop', () => {
const wrapper = mount(Switch, {
propsData: {
size: 20
}
size: 20,
},
});
expect(wrapper).toMatchSnapshot();
@@ -88,9 +88,9 @@ test('click event', () => {
const wrapper = mount(Switch, {
context: {
on: {
click
}
}
click,
},
},
});
wrapper.trigger('click');