mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 15:39:15 +08:00
fix(GridItem): click area (#4518)
This commit is contained in:
parent
8cd2efe354
commit
2d04b23671
@ -82,7 +82,7 @@ export default createComponent({
|
||||
const { center, border, square, gutter, clickable } = this.parent;
|
||||
|
||||
return (
|
||||
<div class={[bem({ square })]} style={this.style} onClick={this.onClick}>
|
||||
<div class={[bem({ square })]} style={this.style}>
|
||||
<div
|
||||
style={this.contentStyle}
|
||||
role={clickable ? 'button' : null}
|
||||
@ -96,6 +96,7 @@ export default createComponent({
|
||||
}),
|
||||
{ [BORDER]: border }
|
||||
]}
|
||||
onClick={this.onClick}
|
||||
>
|
||||
{this.renderContent()}
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@ test('click grid item', () => {
|
||||
}
|
||||
});
|
||||
|
||||
const Item = wrapper.find('.van-grid-item');
|
||||
const Item = wrapper.find('.van-grid-item__content');
|
||||
Item.trigger('click');
|
||||
|
||||
expect(onClick).toHaveBeenCalledTimes(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user