Skip to content

Commit 0173f9d

Browse files
authored
feat(Navbar): add safeAreaInsetTop props (#614)
1 parent d7729ab commit 0173f9d

File tree

22 files changed

+203
-9
lines changed

22 files changed

+203
-9
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-miniprogram/src/navbar/README.en-US.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ home-icon | String | - | `deprecated`。homeIcon | N
1717
left | Slot | - | `0.26.0`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
1818
left-arrow | Boolean | false | `0.26.0` | N
1919
left-icon | String | - | `deprecated` | N
20+
safe-area-inset-top | Boolean | true | \- | N
2021
title | String / Slot | - | page title。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
2122
title-max-length | Number | - | \- | N
2223
visible | Boolean | true | \- | N
@@ -30,6 +31,7 @@ fail | \- | \-
3031
go-back | \- | \-
3132
go-home | \- | `deprecated`
3233
success | \- | \-
34+
3335
### Navbar External Classes
3436

3537
className | Description

packages/products/tdesign-miniprogram/src/navbar/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ home-icon | String | - | 已废弃。首页图标地址。值为 '' 或者 undef
1717
left | Slot | - | `0.26.0`。左侧内容区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
1818
left-arrow | Boolean | false | `0.26.0`。是否展示左侧箭头 | N
1919
left-icon | String | - | 已废弃。左侧图标地址,值为 '' 或者 undefined 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址 | N
20+
safe-area-inset-top | Boolean | true | 是否开启顶部安全区适配 | N
2021
title | String / Slot | - | 页面标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
2122
title-max-length | Number | - | 标题文字最大长度,超出的范围使用 `...` 表示 | N
2223
visible | Boolean | true | 是否显示 | N
@@ -30,6 +31,7 @@ fail | \- | navigateBack 执行失败后触发
3031
go-back | \- | 点击左侧箭头时触发
3132
go-home | \- | 已废弃。点击 Home 触发
3233
success | \- | navigateBack 执行成功后触发
34+
3335
### Navbar External Classes
3436

3537
类名 | 描述

packages/products/tdesign-miniprogram/src/navbar/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ const props: TdNavbarProps = {
2626
type: Boolean,
2727
value: false,
2828
},
29+
/** 是否开启顶部安全区适配 */
30+
safeAreaInsetTop: {
31+
type: Boolean,
32+
value: true,
33+
},
2934
/** 页面标题 */
3035
title: {
3136
type: String,

packages/products/tdesign-miniprogram/src/navbar/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export interface TdNavbarProps {
3737
type: BooleanConstructor;
3838
value?: boolean;
3939
};
40+
/**
41+
* 是否开启顶部安全区适配
42+
* @default true
43+
*/
44+
safeAreaInsetTop?: {
45+
type: BooleanConstructor;
46+
value?: boolean;
47+
};
4048
/**
4149
* 页面标题
4250
*/

packages/products/tdesign-miniprogram/src/tab-bar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ style | Object | - | 样式 | N
1010
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
1111
bordered | Boolean | true | 是否显示外边框 | N
1212
fixed | Boolean | true | 是否固定在底部 | N
13-
safe-area-inset-bottom | Boolean | true | 是否为 iPhoneX 留出底部安全距离 | N
13+
safe-area-inset-bottom | Boolean | true | 是否开启底部安全区适配 | N
1414
shape | String | normal | 标签栏的形状。可选项:normal/round | N
1515
split | Boolean | true | 是否需要分割线 | N
1616
theme | String | normal | 选项风格。可选项:normal/tag | N

packages/products/tdesign-miniprogram/src/tab-bar/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const props: TdTabBarProps = {
1616
type: Boolean,
1717
value: true,
1818
},
19-
/** 是否为 iPhoneX 留出底部安全距离 */
19+
/** 是否开启底部安全区适配 */
2020
safeAreaInsetBottom: {
2121
type: Boolean,
2222
value: true,

packages/products/tdesign-miniprogram/src/tab-bar/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface TdTabBarProps {
2222
value?: boolean;
2323
};
2424
/**
25-
* 是否为 iPhoneX 留出底部安全距离
25+
* 是否开启底部安全区适配
2626
* @default true
2727
*/
2828
safeAreaInsetBottom?: {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
3+
* */
4+
5+
import { TdNavbarProps } from './type';
6+
7+
export const navbarDefaultProps: TdNavbarProps = {
8+
animation: true,
9+
fixed: true,
10+
leftArrow: false,
11+
safeAreaInsetTop: true,
12+
visible: true,
13+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:: BASE_DOC ::
2+
3+
## API
4+
5+
6+
### Navbar Props
7+
8+
name | type | default | description | required
9+
-- | -- | -- | -- | --
10+
className | String | - | className of component | N
11+
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
12+
animation | Boolean | true | \- | N
13+
background | String | - | `deprecated`。background | N
14+
capsule | TElement | - | Typescript:`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
15+
fixed | Boolean | true | \- | N
16+
left | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
17+
leftArrow | Boolean | false | \- | N
18+
right | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
19+
safeAreaInsetTop | Boolean | true | \- | N
20+
title | TNode | - | page title。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
21+
titleMaxLength | Number | - | \- | N
22+
visible | Boolean | true | \- | N
23+
onLeftClick | Function | | Typescript:`() => void`<br/> | N
24+
onRightClick | Function | | Typescript:`() => void`<br/> | N

0 commit comments

Comments
 (0)