Skip to content

Commit

Permalink
fix(mobile-react): remove href/tag API of button from mobile
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
liweijie0812 and github-actions[bot] authored Aug 22, 2024
1 parent c1f3b59 commit 120655b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ children | TNode | - | button's children elements。Typescript:`string \| TNod
content | TNode | - | button's children elements。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
disabled | Boolean | undefined | disable the button, make it can not be clicked | N
ghost | Boolean | false | make background-color to be transparent | N
href | String | - | \- | N
icon | TElement | - | use it to set left icon in button。Typescript:`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
loading | Boolean | false | set button to be loading state | N
loadingProps | Object | - | Typescript:`LoadingProps`[Loading API Documents](./loading?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/button/type.ts) | N
shape | String | rectangle | button shape。options: rectangle/square/round/circle | N
size | String | medium | a button has four size。options: extra-small/small/medium/large | N
suffix | TElement | - | Typescript:`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
tag | String | - | HTML Tag Element。options: button/a/div | N
theme | String | default | button theme。options: default/primary/danger/light | N
type | String | button | type of button element in html。options: submit/reset/button | N
variant | String | base | variant of button。options: base/outline/dashed/text | N
Expand Down
2 changes: 0 additions & 2 deletions packages/products/tdesign-mobile-react/src/button/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ children | TNode | - | 按钮内容,同 content。TS 类型:`string \| TNode
content | TNode | - | 按钮内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
href | String | - | 跳转地址。href 存在时,按钮标签默认使用 `<a>` 渲染;如果指定了 `tag` 则使用指定的标签渲染 | N
icon | TElement | - | 按钮内部图标,可完全自定义。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
loading | Boolean | false | 是否显示为加载状态 | N
loadingProps | Object | - | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`[Loading API Documents](./loading?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/button/type.ts) | N
shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
size | String | medium | 组件尺寸。可选项:extra-small/small/medium/large | N
suffix | TElement | - | 右侧内容,可用于定义右侧图标。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
tag | String | - | 渲染按钮的 HTML 标签,默认使用标签 `<button>` 渲染,可以自定义为 `<a>` `<div>` 等。透传全部 HTML 属性,如:`href/target/data-*` 等。⚠️ 禁用按钮 `<button disabled>`无法显示 Popup 浮层信息,可通过修改 `tag=div` 解决这个问题。可选项:button/a/div | N
theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger/light | N
type | String | button | 按钮类型。可选项:submit/reset/button | N
variant | String | base | 按钮形式,基础、线框、虚线、文字。可选项:base/outline/dashed/text | N
Expand Down
9 changes: 0 additions & 9 deletions packages/products/tdesign-mobile-react/src/button/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ export interface TdButtonProps {
* @default false
*/
ghost?: boolean;
/**
* 跳转地址。href 存在时,按钮标签默认使用 `<a>` 渲染;如果指定了 `tag` 则使用指定的标签渲染
* @default ''
*/
href?: string;
/**
* 按钮内部图标,可完全自定义
*/
Expand Down Expand Up @@ -63,10 +58,6 @@ export interface TdButtonProps {
* 右侧内容,可用于定义右侧图标
*/
suffix?: TElement;
/**
* 渲染按钮的 HTML 标签,默认使用标签 `<button>` 渲染,可以自定义为 `<a>` `<div>` 等。透传全部 HTML 属性,如:`href/target/data-*` 等。⚠️ 禁用按钮 `<button disabled>`无法显示 Popup 浮层信息,可通过修改 `tag=div` 解决这个问题
*/
tag?: 'button' | 'a' | 'div';
/**
* 组件风格,依次为品牌色、危险色
* @default default
Expand Down
16 changes: 4 additions & 12 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -14303,9 +14303,7 @@
"platform_framework": [
"1",
"2",
"4",
"16",
"32"
"4"
],
"component": "Button",
"field_category": 1,
Expand Down Expand Up @@ -14335,9 +14333,7 @@
"platform_framework_text": [
"Vue(PC)",
"React(PC)",
"Angular(PC)",
"React(Mobile)",
"Angular(Mobile)"
"Angular(PC)"
],
"field_type_text": [
"String"
Expand Down Expand Up @@ -15117,9 +15113,7 @@
"platform_framework": [
"1",
"2",
"4",
"16",
"32"
"4"
],
"component": "Button",
"field_category": 1,
Expand Down Expand Up @@ -15149,9 +15143,7 @@
"platform_framework_text": [
"Vue(PC)",
"React(PC)",
"Angular(PC)",
"React(Mobile)",
"Angular(Mobile)"
"Angular(PC)"
],
"field_type_text": [
"String"
Expand Down

0 comments on commit 120655b

Please sign in to comment.