mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
chore: add trailingComma
This commit is contained in:
@@ -101,7 +101,7 @@ export default {
|
||||
customColor: '自定义颜色',
|
||||
pure: '单色按钮',
|
||||
gradient: '渐变色按钮',
|
||||
blockElement: '块级元素'
|
||||
blockElement: '块级元素',
|
||||
},
|
||||
'en-US': {
|
||||
type: 'Type',
|
||||
@@ -130,9 +130,9 @@ export default {
|
||||
customColor: 'Custom Color',
|
||||
pure: 'Pure',
|
||||
gradient: 'Gradient',
|
||||
blockElement: 'Block Element'
|
||||
}
|
||||
}
|
||||
blockElement: 'Block Element',
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -54,7 +54,7 @@ function Button(
|
||||
disabled,
|
||||
loading,
|
||||
hairline,
|
||||
loadingText
|
||||
loadingText,
|
||||
} = props;
|
||||
|
||||
const style: Record<string, string | number> = {};
|
||||
@@ -97,10 +97,10 @@ function Button(
|
||||
hairline,
|
||||
block: props.block,
|
||||
round: props.round,
|
||||
square: props.square
|
||||
}
|
||||
square: props.square,
|
||||
},
|
||||
]),
|
||||
{ [BORDER_SURROUND]: hairline }
|
||||
{ [BORDER_SURROUND]: hairline },
|
||||
];
|
||||
|
||||
function Content() {
|
||||
@@ -165,20 +165,20 @@ Button.props = {
|
||||
loadingType: String,
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'button'
|
||||
default: 'button',
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'default'
|
||||
default: 'default',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'normal'
|
||||
default: 'normal',
|
||||
},
|
||||
loadingSize: {
|
||||
type: String,
|
||||
default: '20px'
|
||||
}
|
||||
default: '20px',
|
||||
},
|
||||
};
|
||||
|
||||
export default createComponent<ButtonProps, ButtonEvents>(Button);
|
||||
|
@@ -5,8 +5,8 @@ test('loading size', () => {
|
||||
const wrapper = mount(Button, {
|
||||
propsData: {
|
||||
loading: true,
|
||||
loadingSize: '10px'
|
||||
}
|
||||
loadingSize: '10px',
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -16,9 +16,9 @@ test('click event', () => {
|
||||
const wrapper = mount(Button, {
|
||||
context: {
|
||||
on: {
|
||||
click: onClick
|
||||
}
|
||||
}
|
||||
click: onClick,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -29,13 +29,13 @@ test('not trigger click event when disabled', () => {
|
||||
const onClick = jest.fn();
|
||||
const wrapper = mount(Button, {
|
||||
propsData: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
click: onClick
|
||||
}
|
||||
}
|
||||
click: onClick,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -46,13 +46,13 @@ test('not trigger click event when loading', () => {
|
||||
const onClick = jest.fn();
|
||||
const wrapper = mount(Button, {
|
||||
propsData: {
|
||||
loading: true
|
||||
loading: true,
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
click: onClick
|
||||
}
|
||||
}
|
||||
click: onClick,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -64,9 +64,9 @@ test('touchstart event', () => {
|
||||
const wrapper = mount(Button, {
|
||||
context: {
|
||||
on: {
|
||||
touchstart: onTouchstart
|
||||
}
|
||||
}
|
||||
touchstart: onTouchstart,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('touchstart');
|
||||
@@ -76,8 +76,8 @@ test('touchstart event', () => {
|
||||
test('hide border when color is gradient', () => {
|
||||
const wrapper = mount(Button, {
|
||||
propsData: {
|
||||
color: 'linear-gradient(#000, #fff)'
|
||||
}
|
||||
color: 'linear-gradient(#000, #fff)',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.element.style.border).toEqual('0px');
|
||||
|
Reference in New Issue
Block a user