diff --git a/example/pages/sidebar/index.wxml b/example/pages/sidebar/index.wxml index ca9558f3..fc193823 100644 --- a/example/pages/sidebar/index.wxml +++ b/example/pages/sidebar/index.wxml @@ -12,8 +12,8 @@

徽标提示

- - + + diff --git a/packages/sidebar-item/index.ts b/packages/sidebar-item/index.ts index 00c39dfc..a4dfdf3a 100644 --- a/packages/sidebar-item/index.ts +++ b/packages/sidebar-item/index.ts @@ -11,6 +11,7 @@ VantComponent({ props: { dot: Boolean, + badge: null, info: null, title: String, disabled: Boolean, diff --git a/packages/sidebar-item/index.wxml b/packages/sidebar-item/index.wxml index ab8c6c42..c5c08a62 100644 --- a/packages/sidebar-item/index.wxml +++ b/packages/sidebar-item/index.wxml @@ -8,10 +8,9 @@ > {{ title }} diff --git a/packages/sidebar/README.md b/packages/sidebar/README.md index f19d0cae..3eaf6aea 100644 --- a/packages/sidebar/README.md +++ b/packages/sidebar/README.md @@ -37,13 +37,13 @@ Page({ ### 徽标提示 -设置`dot`属性后,会在右上角展示一个小红点。设置`dot`属性后,会在右上角展示相应的徽标 +设置`dot`属性后,会在右上角展示一个小红点。设置`badge`属性后,会在右上角展示相应的徽标 ```html - - + + ``` @@ -109,12 +109,13 @@ Page({ ### SidebarItem Props -| 参数 | 说明 | 类型 | 默认值 | -| -------- | -------------------- | ------------------ | ------- | -| title | 内容 | _string_ | `''` | -| dot | 是否显示右上角小红点 | _boolean_ | `false` | -| info | 提示消息 | _string \| number_ | `''` | -| disabled | 是否禁用该项 | _boolean_ | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| title | 内容 | _string_ | `''` | +| dot | 是否显示右上角小红点 | _boolean_ | `false` | +| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | _string \| number_ | `''` | +| badge `v1.5.0` | 图标右上角徽标的内容 | _string \| number_ | `''` | +| disabled | 是否禁用该项 | _boolean_ | `false` | ### SidebarItem Slot diff --git a/packages/sidebar/index.ts b/packages/sidebar/index.ts index cfd8822c..4a92653e 100644 --- a/packages/sidebar/index.ts +++ b/packages/sidebar/index.ts @@ -35,7 +35,7 @@ VantComponent({ this.currentActive = activeKey; - const stack = []; + const stack: Promise[] = []; if (currentActive !== activeKey && children[currentActive]) { stack.push(children[currentActive].setActive(false));