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

View File

@@ -32,7 +32,7 @@
<van-tabbar-item info="3">
<span>{{ $t('custom') }}</span>
<template #icon="props">
<img :src="props.active ? icon.active : icon.inactive">
<img :src="props.active ? icon.active : icon.inactive" />
</template>
</van-tabbar-item>
<van-tabbar-item icon="search">{{ $t('tab') }}</van-tabbar-item>
@@ -69,7 +69,7 @@ export default {
customColor: '自定义颜色',
matchByName: '通过名称匹配',
switchEvent: '监听切换事件',
selectTip: '你切换到了'
selectTip: '你切换到了',
},
'en-US': {
badge: 'Show Badge',
@@ -77,8 +77,8 @@ export default {
customColor: 'Custom Color',
matchByName: 'Match by name',
switchEvent: 'Change Event',
selectTip: 'You select '
}
selectTip: 'You select ',
},
},
data() {
@@ -91,8 +91,8 @@ export default {
activeName: 'home',
icon: {
active: 'https://img.yzcdn.cn/vant/user-active.png',
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
}
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png',
},
};
},
@@ -100,10 +100,10 @@ export default {
onChange(index) {
this.$notify({
type: 'primary',
message: `${this.$t('selectTip')} ${this.$t('tab')}${index + 1}`
message: `${this.$t('selectTip')} ${this.$t('tab')}${index + 1}`,
});
}
}
},
},
};
</script>

View File

@@ -14,25 +14,25 @@ export default createComponent({
safeAreaInsetBottom: Boolean,
value: {
type: [Number, String],
default: 0
default: 0,
},
border: {
type: Boolean,
default: true
default: true,
},
fixed: {
type: Boolean,
default: true
default: true,
},
zIndex: {
type: Number,
default: 1
}
default: 1,
},
},
watch: {
value: 'setActiveItem',
children: 'setActiveItem'
children: 'setActiveItem',
},
methods: {
@@ -47,7 +47,7 @@ export default createComponent({
this.$emit('input', active);
this.$emit('change', active);
}
}
},
},
render() {
@@ -58,12 +58,12 @@ export default createComponent({
{ [BORDER_TOP_BOTTOM]: this.border },
bem({
fixed: this.fixed,
'safe-area-inset-bottom': this.safeAreaInsetBottom
})
'safe-area-inset-bottom': this.safeAreaInsetBottom,
}),
]}
>
{this.slots()}
</div>
);
}
},
});

View File

@@ -24,7 +24,7 @@ test('route mode', async () => {
Tab
</van-tabbar-item>
</van-tabbar>
`
`,
});
expect(wrapper).toMatchSnapshot();
@@ -47,8 +47,8 @@ test('route mode match by name', async () => {
const router = new VueRouter({
routes: [
{ path: '/foo', component: Foo, name: 'foo' },
{ path: '/bar', component: Bar, name: 'bar' }
]
{ path: '/bar', component: Bar, name: 'bar' },
],
});
const wrapper = mount({
@@ -62,7 +62,7 @@ test('route mode match by name', async () => {
Tab
</van-tabbar-item>
</van-tabbar>
`
`,
});
const items = wrapper.findAll('.van-tabbar-item');
@@ -86,7 +86,7 @@ test('router NavigationDuplicated', async done => {
Tab
</van-tabbar-item>
</van-tabbar>
`
`,
});
const item = wrapper.find('.van-tabbar-item');
@@ -108,9 +108,9 @@ test('watch tabbar value', () => {
`,
data() {
return {
value: 0
value: 0,
};
}
},
});
wrapper.setData({ value: 1 });
@@ -129,8 +129,8 @@ test('click event', () => {
`,
methods: {
onClick,
onChange
}
onChange,
},
});
wrapper.find('.van-tabbar-item').trigger('click');
@@ -149,12 +149,12 @@ test('name prop', () => {
`,
data() {
return {
value: 'a'
value: 'a',
};
},
methods: {
onChange
}
onChange,
},
});
wrapper
@@ -168,8 +168,8 @@ test('name prop', () => {
test('disable border', () => {
const wrapper = mount(Tabbar, {
propsData: {
border: false
}
border: false,
},
});
expect(wrapper).toMatchSnapshot();