breaking change: rename Info to Badge
This commit is contained in:
@@ -98,7 +98,6 @@ export default {
|
||||
| icon-class | 图标额外类名 | _any_ | - |
|
||||
| dot `2.5.5` | 是否显示图标右上角小红点 | _boolean_ | `false` |
|
||||
| badge `v2.5.6` | 图标右上角徽标的内容 | _number \| string_ | - |
|
||||
| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | _number \| string_ | - |
|
||||
| url | 点击后跳转的链接地址 | _string_ | - |
|
||||
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - |
|
||||
| replace | 是否在跳转时替换当前页面历史 | _boolean_ | `false` |
|
||||
|
||||
@@ -27,17 +27,17 @@ exports[`renders demo correctly 1`] = `
|
||||
<div class="van-action-bar">
|
||||
<div role="button" tabindex="0" class="van-action-bar-icon">
|
||||
<div class="van-icon van-icon-chat-o van-action-bar-icon__icon">
|
||||
<div class="van-info van-info--dot"></div>
|
||||
<div class="van-badge van-badge--dot"></div>
|
||||
</div>客服
|
||||
</div>
|
||||
<div role="button" tabindex="0" class="van-action-bar-icon">
|
||||
<div class="van-icon van-icon-cart-o van-action-bar-icon__icon">
|
||||
<div class="van-info">5</div>
|
||||
<div class="van-badge">5</div>
|
||||
</div>购物车
|
||||
</div>
|
||||
<div role="button" tabindex="0" class="van-action-bar-icon">
|
||||
<div class="van-icon van-icon-shop-o van-action-bar-icon__icon">
|
||||
<div class="van-info">12</div>
|
||||
<div class="van-badge">12</div>
|
||||
</div>店铺
|
||||
</div> <button class="van-button van-button--warning van-button--large van-action-bar-button van-action-bar-button--first van-action-bar-button--warning">
|
||||
<div class="van-button__content"><span class="van-button__text">加入购物车</span></div>
|
||||
|
||||
@@ -24,14 +24,14 @@ exports[`Icon render icon slot 1`] = `
|
||||
|
||||
exports[`Icon render icon slot with dot 1`] = `
|
||||
<div role="button" tabindex="0" class="van-action-bar-icon">
|
||||
<div class="van-action-bar-icon__icon">Custom Icon<div class="van-info van-info--dot"></div>
|
||||
<div class="van-action-bar-icon__icon">Custom Icon<div class="van-badge van-badge--dot"></div>
|
||||
</div>Text
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Icon render icon slot with info 1`] = `
|
||||
exports[`Icon render icon slot with badge 1`] = `
|
||||
<div role="button" tabindex="0" class="van-action-bar-icon">
|
||||
<div class="van-action-bar-icon__icon">Custom Icon<div class="van-info">1</div>
|
||||
<div class="van-action-bar-icon__icon">Custom Icon<div class="van-badge">1</div>
|
||||
</div>Text
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -50,12 +50,12 @@ test('Icon render icon slot', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Icon render icon slot with info', () => {
|
||||
test('Icon render icon slot with badge', () => {
|
||||
const wrapper = mount({
|
||||
render(h) {
|
||||
return h(Icon, {
|
||||
props: {
|
||||
info: '1',
|
||||
badge: '1',
|
||||
},
|
||||
scopedSlots: {
|
||||
default: () => 'Text',
|
||||
|
||||
Reference in New Issue
Block a user