chore: add trailingComma
This commit is contained in:
@@ -120,7 +120,7 @@ export default {
|
||||
filled: '实底风格',
|
||||
demo: '用法示例',
|
||||
color: '图标颜色',
|
||||
size: '图标大小'
|
||||
size: '图标大小',
|
||||
},
|
||||
'en-US': {
|
||||
title: 'Icon List',
|
||||
@@ -131,8 +131,8 @@ export default {
|
||||
filled: 'Filled',
|
||||
demo: 'Demo',
|
||||
color: 'Icon Color',
|
||||
size: 'Icon Size'
|
||||
}
|
||||
size: 'Icon Size',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -142,7 +142,7 @@ export default {
|
||||
return {
|
||||
tab: 0,
|
||||
demoIcon: 'chat-o',
|
||||
demoImage: 'https://b.yzcdn.cn/vant/icon-demo-1126.png'
|
||||
demoImage: 'https://b.yzcdn.cn/vant/icon-demo-1126.png',
|
||||
};
|
||||
},
|
||||
|
||||
@@ -168,10 +168,10 @@ export default {
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
className: 'demo-icon-notify',
|
||||
message: `${this.$t('copied')}:${tag}`
|
||||
message: `${this.$t('copied')}:${tag}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+6
-6
@@ -29,7 +29,7 @@ function isImage(name?: string): boolean {
|
||||
// compatible with legacy usage, should be removed in next major version
|
||||
const LEGACY_MAP: Record<string, string> = {
|
||||
medel: 'medal',
|
||||
'medel-o': 'medal-o'
|
||||
'medel-o': 'medal-o',
|
||||
};
|
||||
|
||||
function correctName(name?: string) {
|
||||
@@ -49,11 +49,11 @@ function Icon(
|
||||
<props.tag
|
||||
class={[
|
||||
props.classPrefix,
|
||||
imageIcon ? '' : `${props.classPrefix}-${name}`
|
||||
imageIcon ? '' : `${props.classPrefix}-${name}`,
|
||||
]}
|
||||
style={{
|
||||
color: props.color,
|
||||
fontSize: addUnit(props.size)
|
||||
fontSize: addUnit(props.size),
|
||||
}}
|
||||
{...inherit(ctx, true)}
|
||||
>
|
||||
@@ -72,12 +72,12 @@ Icon.props = {
|
||||
color: String,
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'i'
|
||||
default: 'i',
|
||||
},
|
||||
classPrefix: {
|
||||
type: String,
|
||||
default: bem()
|
||||
}
|
||||
default: bem(),
|
||||
},
|
||||
};
|
||||
|
||||
export default createComponent<IconProps, IconEvents>(Icon);
|
||||
|
||||
+13
-13
@@ -4,8 +4,8 @@ import { mount } from '../../../test';
|
||||
test('render icon with builtin icon name', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
name: 'success'
|
||||
}
|
||||
name: 'success',
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -13,8 +13,8 @@ test('render icon with builtin icon name', () => {
|
||||
test('render icon with url name', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
name: 'https://img.yzcdn.com/icon.jpg'
|
||||
}
|
||||
name: 'https://img.yzcdn.com/icon.jpg',
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -22,8 +22,8 @@ test('render icon with url name', () => {
|
||||
test('render icon with local image', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
name: '/assets/icon.jpg'
|
||||
}
|
||||
name: '/assets/icon.jpg',
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -32,7 +32,7 @@ test('render icon default slot', () => {
|
||||
const wrapper = mount({
|
||||
render(h) {
|
||||
return h(Icon, { props: { name: 'success' } }, ['Default slot']);
|
||||
}
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -40,8 +40,8 @@ test('render icon default slot', () => {
|
||||
test('tag prop', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
tag: 'div'
|
||||
}
|
||||
tag: 'div',
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -49,8 +49,8 @@ test('tag prop', () => {
|
||||
test('dot prop', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
dot: true
|
||||
}
|
||||
dot: true,
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -58,8 +58,8 @@ test('dot prop', () => {
|
||||
test('size without unit', () => {
|
||||
const wrapper = mount(Icon, {
|
||||
propsData: {
|
||||
size: 20
|
||||
}
|
||||
size: 20,
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user