[improvement] GoodsAction: improve accessibility

This commit is contained in:
陈嘉涵 2019-05-25 12:20:15 +08:00
parent 6cc14d8651
commit 06cf2f3f57
4 changed files with 13 additions and 7 deletions

View File

@ -11,6 +11,7 @@
- Slider
- Switch
- NoticeBar
- GoodsAction
##### ImagePreview

View File

@ -28,7 +28,12 @@ function GoodsActionIcon(
}
return (
<div class={[bem(), 'van-hairline']} onClick={onClick} {...inherit(ctx)}>
<div
role="button"
class={[bem(), 'van-hairline']}
onClick={onClick}
{...inherit(ctx)}
>
<Icon
class={[bem('icon'), props.iconClass]}
tag="div"

View File

@ -4,12 +4,12 @@ exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-goods-action">
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-chat-o van-goods-action-icon__icon">
<!---->
</div>客服
</div>
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-cart-o van-goods-action-icon__icon">
<!---->
</div>购物车
@ -18,17 +18,17 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-goods-action">
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-chat-o van-goods-action-icon__icon">
<!---->
</div>客服
</div>
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-cart-o van-goods-action-icon__icon">
<div class="van-info">5</div>
</div>购物车
</div>
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-shop-o van-goods-action-icon__icon">
<!---->
</div>店铺

View File

@ -3,7 +3,7 @@
exports[`Button render default slot 1`] = `<button class="van-button van-button--default van-button--large van-button--square van-goods-action-button"><span class="van-button__text">Default Content</span></button>`;
exports[`Icon render default slot 1`] = `
<div class="van-goods-action-icon van-hairline">
<div role="button" class="van-goods-action-icon van-hairline">
<div class="van-icon van-icon-undefined van-goods-action-icon__icon">
<!---->
</div>Default Content