Skip to content

Commit

Permalink
fix(collapse): resolve reserved property warning (#2997)
Browse files Browse the repository at this point in the history
  • Loading branch information
oljc authored Mar 1, 2024
1 parent ccc71fb commit 933b02b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
7 changes: 6 additions & 1 deletion packages/web-vue/components/collapse/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ description: The content area that can be collapsed/expanded.

|Attribute|Description|Type|Default|version|
|---|---|---|:---:|:---|
|key|The id of the panel, corresponding to the value in `activeKey`|`string\|number`|`-`||
|header|The title of the panel|`string`|`-`||
|disabled|Whether to disable|`boolean`|`false`||
|show-expand-icon|Whether to show the expand icon|`boolean`|`true`||
Expand All @@ -67,3 +66,9 @@ description: The content area that can be collapsed/expanded.
|header|The title of the panel|-||



## FAQ


### The `key` attribute of `<CollapseItem>` components is required
In the `<Collapse>` component, each `<CollapseItem>` needs to specify a unique `key` attribute, and the `key` corresponding to the value in `activeKey`.
7 changes: 6 additions & 1 deletion packages/web-vue/components/collapse/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ description: 可以折叠 / 展开的内容区域。

|参数名|描述|类型|默认值|版本|
|---|---|---|:---:|:---|
|key|面板的 id,对应 `activeKey` 中的值|`string\|number`|`-`||
|header|面板的标题|`string`|`-`||
|disabled|是否禁用|`boolean`|`false`||
|show-expand-icon|是否显示展开图标|`boolean`|`true`||
Expand All @@ -65,3 +64,9 @@ description: 可以折叠 / 展开的内容区域。
|header|面板的标题|-||



## FAQ

### `<CollapseItem>` 组件的 `key` 属性为必填
在 `<Collapse>` 组件中每个 `<CollapseItem>` 都需要指定唯一的 `key` 属性,`key` 对应 `activeKey` 中的值。

14 changes: 14 additions & 0 deletions packages/web-vue/components/collapse/TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@ description: The content area that can be collapsed/expanded.
%%API(collapse.vue)%%
%%API(collapse-item.tsx)%%
## FAQ
## zh-CN
### `<CollapseItem>` 组件的 `key` 属性为必填
在 `<Collapse>` 组件中每个 `<CollapseItem>` 都需要指定唯一的 `key` 属性,`key` 对应 `activeKey` 中的值。

---

## en-US
### The `key` attribute of `<CollapseItem>` components is required
In the `<Collapse>` component, each `<CollapseItem>` needs to specify a unique `key` attribute, and the `key` corresponding to the value in `activeKey`.

---
5 changes: 0 additions & 5 deletions packages/web-vue/components/collapse/collapse-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ export default defineComponent({
name: 'CollapseItem',
components: { IconHover, IconCaretRight, IconCaretLeft },
props: {
/**
* @zh 面板的 id,对应 `activeKey` 中的值
* @en The id of the panel, corresponding to the value in `activeKey`
*/
key: [String, Number],
/**
* @zh 面板的标题
* @en The title of the panel
Expand Down

0 comments on commit 933b02b

Please sign in to comment.