Skip to content

Commit b0e1520

Browse files
authored
feat(Divider): adjust size api (#732)
1 parent 9e76b04 commit b0e1520

File tree

16 files changed

+157
-19
lines changed

16 files changed

+157
-19
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-mobile-react/src/divider/divider.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ children | TNode | - | Typescript:`string \| TNode`。[see more ts definition]
1313
content | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
1414
dashed | Boolean | false | \- | N
1515
layout | String | horizontal | options: horizontal/vertical | N
16+
size | Number | - | Spacing size | N

packages/products/tdesign-mobile-react/src/divider/divider.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ children | TNode | - | 子元素,同 content。TS 类型:`string \| TNode`
1313
content | TNode | - | 子元素。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
1414
dashed | Boolean | false | 是否虚线(仅在水平分割线有效) | N
1515
layout | String | horizontal | 分隔线类型有两种:水平和垂直。可选项:horizontal/vertical | N
16+
size | Number | - | 间距大小 | N

packages/products/tdesign-mobile-react/src/divider/type.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ export interface TdDividerProps {
3030
* @default horizontal
3131
*/
3232
layout?: 'horizontal' | 'vertical';
33+
/**
34+
* 间距大小
35+
*/
36+
size?: number;
3337
}

packages/products/tdesign-mobile-vue/src/divider/divider.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ content | String / Slot / Function | - | Typescript:`string \| TNode`。[see m
1111
dashed | Boolean | false | \- | N
1212
default | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
1313
layout | String | horizontal | options: horizontal/vertical | N
14+
size | Number | - | Spacing size | N

packages/products/tdesign-mobile-vue/src/divider/divider.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ content | String / Slot / Function | - | 子元素。TS 类型:`string \| TNod
1111
dashed | Boolean | false | 是否虚线(仅在水平分割线有效) | N
1212
default | String / Slot / Function | - | 子元素,同 content。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
1313
layout | String | horizontal | 分隔线类型有两种:水平和垂直。可选项:horizontal/vertical | N
14+
size | Number | - | 间距大小 | N
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* eslint-disable */
2+
3+
/**
4+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
5+
* */
6+
7+
import { TdDividerProps } from './type';
8+
import { PropType } from 'vue';
9+
10+
export default {
11+
/** 文本位置(仅在水平分割线有效) */
12+
align: {
13+
type: String as PropType<TdDividerProps['align']>,
14+
default: 'center' as TdDividerProps['align'],
15+
validator(val: TdDividerProps['align']): boolean {
16+
if (!val) return true;
17+
return ['left', 'right', 'center'].includes(val);
18+
},
19+
},
20+
/** 子元素 */
21+
content: {
22+
type: [String, Function] as PropType<TdDividerProps['content']>,
23+
},
24+
/** 是否虚线(仅在水平分割线有效) */
25+
dashed: Boolean,
26+
/** 子元素,同 content */
27+
default: {
28+
type: [String, Function] as PropType<TdDividerProps['default']>,
29+
},
30+
/** 分隔线类型有两种:水平和垂直 */
31+
layout: {
32+
type: String as PropType<TdDividerProps['layout']>,
33+
default: 'horizontal' as TdDividerProps['layout'],
34+
validator(val: TdDividerProps['layout']): boolean {
35+
if (!val) return true;
36+
return ['horizontal', 'vertical'].includes(val);
37+
},
38+
},
39+
/** 间距大小 */
40+
size: {
41+
type: Number,
42+
},
43+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-disable */
2+
3+
/**
4+
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
5+
* */
6+
7+
import { TNode } from '../common';
8+
9+
export interface TdDividerProps {
10+
/**
11+
* 文本位置(仅在水平分割线有效)
12+
* @default center
13+
*/
14+
align?: 'left' | 'right' | 'center';
15+
/**
16+
* 子元素
17+
*/
18+
content?: string | TNode;
19+
/**
20+
* 是否虚线(仅在水平分割线有效)
21+
* @default false
22+
*/
23+
dashed?: boolean;
24+
/**
25+
* 子元素,同 content
26+
*/
27+
default?: string | TNode;
28+
/**
29+
* 分隔线类型有两种:水平和垂直
30+
* @default horizontal
31+
*/
32+
layout?: 'horizontal' | 'vertical';
33+
/**
34+
* 间距大小
35+
*/
36+
size?: number;
37+
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
:: BASE_DOC ::
22

33
## API
4+
45
### Divider Props
56

67
name | type | default | description | required
78
-- | -- | -- | -- | --
8-
className | String | - | 类名 | N
9-
style | Object | - | 样式,Typescript:`React.CSSProperties` | N
10-
align | String | center | optionsleft/right/center | N
9+
className | String | - | className of component | N
10+
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
11+
align | String | center | options: left/right/center | N
1112
children | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
1213
content | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
1314
dashed | Boolean | false | \- | N
14-
layout | String | horizontal | options:horizontal/vertical | N
15+
layout | String | horizontal | options: horizontal/vertical | N
16+
size | Number | - | Spacing size | N
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
:: BASE_DOC ::
22

33
## API
4+
45
### Divider Props
56

6-
名称 | 类型 | 默认值 | 说明 | 必传
7+
名称 | 类型 | 默认值 | 描述 | 必传
78
-- | -- | -- | -- | --
89
className | String | - | 类名 | N
910
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
@@ -12,3 +13,4 @@ children | TNode | - | 子元素,同 content。TS 类型:`string \| TNode`
1213
content | TNode | - | 子元素。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
1314
dashed | Boolean | false | 是否虚线(仅在水平分割线有效) | N
1415
layout | String | horizontal | 分隔线类型有两种:水平和垂直。可选项:horizontal/vertical | N
16+
size | Number | - | 间距大小 | N

0 commit comments

Comments
 (0)