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
+6 -6
View File
@@ -119,7 +119,7 @@ export default {
title9: '滑动切换',
title10: '滚动导航',
disabled: ' 已被禁用',
matchByName: '通过名称匹配'
matchByName: '通过名称匹配',
},
'en-US': {
tab: 'Tab ',
@@ -134,15 +134,15 @@ export default {
title9: 'Swipeable',
title10: 'Scrollspy',
disabled: ' is disabled',
matchByName: 'Match By Name'
}
matchByName: 'Match By Name',
},
},
data() {
return {
active: 2,
activeName: 'b',
tabs: [1, 2, 3, 4]
tabs: [1, 2, 3, 4],
};
},
@@ -153,8 +153,8 @@ export default {
onClick(index, title) {
this.$toast(title);
}
}
},
},
};
</script>
+5 -5
View File
@@ -14,12 +14,12 @@ export default createComponent({
name: [Number, String],
title: String,
titleStyle: null,
disabled: Boolean
disabled: Boolean,
},
data() {
return {
inited: false
inited: false,
};
},
@@ -30,7 +30,7 @@ export default createComponent({
isActive() {
return this.computedName === this.parent.currentName;
}
},
},
watch: {
@@ -49,7 +49,7 @@ export default createComponent({
this.parent.$emit('rendered', this.computedName, this.title);
});
}
}
},
},
render(h) {
@@ -75,5 +75,5 @@ export default createComponent({
{Content}
</div>
);
}
},
});
+27 -27
View File
@@ -24,10 +24,10 @@ function createWrapper(options = {}) {
type: 'line',
sticky: true,
lineWidth: 2,
lazyRender: true
lazyRender: true,
};
},
...options
...options,
});
}
@@ -42,8 +42,8 @@ test('click to switch tab', async () => {
</van-tabs>
`,
methods: {
onChange
}
onChange,
},
});
await later();
@@ -68,8 +68,8 @@ test('swipe to switch tab', async () => {
</van-tabs>
`,
methods: {
onChange
}
onChange,
},
});
const content = wrapper.find('.van-tabs__content');
@@ -100,7 +100,7 @@ test('change tabs data', async () => {
swipeable: false,
sticky: false,
type: 'card',
color: 'blue'
color: 'blue',
});
await later();
@@ -113,7 +113,7 @@ test('lazy render', async () => {
expect(wrapper).toMatchSnapshot();
wrapper.setData({
lazyRender: false
lazyRender: false,
});
await later();
@@ -125,7 +125,7 @@ test('render nav-left & nav-right slot', async () => {
extraTemplate: `
<template v-slot:nav-left>Nav Left</template>
<template v-slot:nav-right>Nav Right</template>
`
`,
});
expect(wrapper).toMatchSnapshot();
@@ -134,8 +134,8 @@ test('render nav-left & nav-right slot', async () => {
test('border props', async () => {
const wrapper = mount(Tabs, {
propsData: {
border: false
}
border: false,
},
});
expect(wrapper).toMatchSnapshot();
@@ -155,8 +155,8 @@ test('click event', async () => {
`,
methods: {
onClick,
onDisabled
}
onDisabled,
},
});
const tabs = wrapper.findAll('.van-tab');
@@ -184,8 +184,8 @@ test('name prop', async () => {
methods: {
onClick,
onChange,
onDisabled
}
onDisabled,
},
});
await later();
@@ -214,8 +214,8 @@ test('set name to zero', async () => {
</van-tabs>
`,
methods: {
onClick
}
onClick,
},
});
const tabs = wrapper.findAll('.van-tab');
@@ -229,7 +229,7 @@ test('title-style prop', () => {
<van-tabs>
<van-tab title="title1" title-style="color: red;">Text</van-tab>
</van-tabs>
`
`,
});
expect(wrapper.find('.van-tab').element.style.color).toEqual('red');
@@ -241,7 +241,7 @@ test('dot prop', () => {
<van-tabs>
<van-tab dot>Text</van-tab>
</van-tabs>
`
`,
});
expect(wrapper).toMatchSnapshot();
@@ -253,7 +253,7 @@ test('info prop', () => {
<van-tabs>
<van-tab info="10">Text</van-tab>
</van-tabs>
`
`,
});
expect(wrapper).toMatchSnapshot();
@@ -272,8 +272,8 @@ test('scrollspy', async () => {
</van-tabs>
`,
methods: {
onChange
}
onChange,
},
});
await later();
@@ -301,12 +301,12 @@ test('rendered event', async () => {
`,
data() {
return {
active: 'a'
active: 'a',
};
},
methods: {
onRendered
}
onRendered,
},
});
await later();
@@ -332,8 +332,8 @@ test('should not trigger rendered event when disable lazy-render', async () => {
</van-tabs>
`,
methods: {
onRendered
}
onRendered,
},
});
await later();