chore: prettier source code

This commit is contained in:
chenjiahan
2020-04-02 15:36:02 +08:00
parent 340c56b3b5
commit 2fb5cca49a
93 changed files with 272 additions and 283 deletions
+8 -6
View File
@@ -14,7 +14,7 @@ function pickSlots(instance, keys) {
const { $slots, $scopedSlots } = instance;
const scopedSlots = {};
keys.forEach(key => {
keys.forEach((key) => {
if ($scopedSlots[key]) {
scopedSlots[key] = $scopedSlots[key];
} else if ($slots[key]) {
@@ -111,7 +111,7 @@ export default createComponent({
}
const list = this[type];
result = Object.keys(list).map(listCode => ({
result = Object.keys(list).map((listCode) => ({
code: listCode,
name: list[listCode],
}));
@@ -122,7 +122,7 @@ export default createComponent({
code = '9';
}
result = result.filter(item => item.code.indexOf(code) === 0);
result = result.filter((item) => item.code.indexOf(code) === 0);
}
if (this.placeholderMap[type] && result.length) {
@@ -239,7 +239,9 @@ export default createComponent({
getValues() {
const { picker } = this.$refs;
let getValues = picker ? picker.getValues().filter(value => !!value) : [];
let getValues = picker
? picker.getValues().filter((value) => !!value)
: [];
getValues = this.parseOutputValues(getValues);
return getValues;
},
@@ -258,8 +260,8 @@ export default createComponent({
return area;
}
const names = values.map(item => item.name);
const validValues = values.filter(value => !!value.code);
const names = values.map((item) => item.name);
const validValues = values.filter((value) => !!value.code);
area.code = validValues.length
? validValues[validValues.length - 1].code
+2 -8
View File
@@ -70,17 +70,11 @@ test('change option', () => {
expect(wrapper).toMatchSnapshot();
triggerDrag(columns.at(0), 0, -100);
columns
.at(0)
.find('ul')
.trigger('transitionend');
columns.at(0).find('ul').trigger('transitionend');
expect(wrapper).toMatchSnapshot();
triggerDrag(columns.at(2), 0, -100);
columns
.at(2)
.find('ul')
.trigger('transitionend');
columns.at(2).find('ul').trigger('transitionend');
expect(wrapper).toMatchSnapshot();
expect(onChange.mock.calls[0][1]).toEqual(secondOption);