-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 新增 Space 组件 * feat: 新增 Space 组件 * feat: live demo * feat: 优化文案 * fix: space props * feat: update common Co-authored-by: pengYYY <pengyue970715@gmail.com>
- Loading branch information
1 parent
e04ba22
commit 1598b85
Showing
31 changed files
with
1,260 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<template> | ||
<div> | ||
<span>正直</span> | ||
<t-divider theme="vertical" /> | ||
<t-divider layout="vertical" /> | ||
<span>进取</span> | ||
<t-divider theme="vertical" /> | ||
<t-divider layout="vertical" /> | ||
<span>合作</span> | ||
<t-divider theme="vertical" dashed /> | ||
<t-divider layout="vertical" dashed /> | ||
<span>创新</span> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<t-space break-line> | ||
<t-space align="start" class="space-border"> | ||
<div>start</div> | ||
<t-button>Button</t-button> | ||
<div class="space-block"></div> | ||
</t-space> | ||
<t-space align="center" class="space-border"> | ||
<div>center</div> | ||
<t-button>Button</t-button> | ||
<div class="space-block"></div> | ||
</t-space> | ||
<t-space align="end" class="space-border"> | ||
<div>end</div> | ||
<t-button>Button</t-button> | ||
<div class="space-block"></div> | ||
</t-space> | ||
<t-space align="baseline" class="space-border"> | ||
<div>baseline</div> | ||
<t-button>Button</t-button> | ||
<div class="space-block"></div> | ||
</t-space> | ||
</t-space> | ||
</template> | ||
|
||
<style scoped> | ||
.space-border { | ||
padding: 12; | ||
border: 1px dashed var(--td-component-stroke); | ||
} | ||
.space-block { | ||
background: var(--td-bg-color-component); | ||
height: 60px; | ||
width: 60px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<t-space> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
</t-space> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<t-space break-line> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
</t-space> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<t-space align="center" :separator="separator"> | ||
<t-button variant="text">Text</t-button> | ||
<t-button variant="text">Text</t-button> | ||
<t-button variant="text">Text</t-button> | ||
</t-space> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
const separator = <t-divider layout="vertical" />; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div> | ||
<t-slider v-model="size"></t-slider> | ||
<br /> | ||
<t-space :size="size"> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
</t-space> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const size = ref(8); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-card title="标题" actions="操作" header bordered hover-shadow> | ||
仅有内容区域的卡片形式。卡片内容区域可以是文字、图片、表单、表格等形式信息内容。可使用大中小不同的卡片尺寸,按业务需求进行呈现。 | ||
</t-card> | ||
<t-card title="标题" actions="操作" header bordered hover-shadow> | ||
仅有内容区域的卡片形式。卡片内容区域可以是文字、图片、表单、表格等形式信息内容。可使用大中小不同的卡片尺寸,按业务需求进行呈现。 | ||
</t-card> | ||
<t-card title="标题" actions="操作" header bordered hover-shadow> | ||
仅有内容区域的卡片形式。卡片内容区域可以是文字、图片、表单、表格等形式信息内容。可使用大中小不同的卡片尺寸,按业务需求进行呈现。 | ||
</t-card> | ||
</t-space> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Space Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
-- | -- | -- | -- | -- | ||
align | String | - | 对齐方式。可选项:start/end/center/baseline | N | ||
breakLine | Boolean | false | 是否自动换行,仅在 horizontal 时有效 | N | ||
direction | String | horizontal | 间距方向。可选项:vertical/horizontal | N | ||
separator | String / Slot / Function | - | 分隔符。TS 类型:`string | TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
size | String / Number | medium | 间距大小。可选项:small/medium/large。TS 类型:`SpaceSize | SpaceSize[]` `type SpaceSize = number | string | SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/space/type.ts) | N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- 该脚本为自动生成,如有需要请在 /script/generate-usage/index.js 中调整 --> | ||
<template> | ||
<base-usage :code="usageCode" :config-list="configList" :panel-list="panelList" @PanelChange="onPanelChange"> | ||
<template #space="{ configProps }" | ||
><t-space v-bind="configProps"> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
<t-button>Button</t-button> | ||
</t-space></template | ||
> | ||
</base-usage> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
/* eslint-disable */ | ||
import { ref, onMounted } from 'vue'; | ||
import configJson from './props.json'; | ||
const configList = ref(configJson); | ||
const panelList = [{ label: 'space', value: 'space' }]; | ||
const usageCodeMap = { | ||
space: | ||
'\n <t-space v-bind="configProps">\n <t-button>Button</t-button>\n <t-button>Button</t-button>\n <t-button>Button</t-button>\n <t-button>Button</t-button>\n </t-space>\n ', | ||
}; | ||
const usageCode = ref(`<template>${usageCodeMap[panelList[0].value].trim()}</template>`); | ||
function onPanelChange(panel) { | ||
usageCode.value = `<template>${usageCodeMap[panel].trim()}</template>`; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"name": "breakLine", | ||
"type": "Boolean", | ||
"defaultValue": false, | ||
"options": [] | ||
}, | ||
{ | ||
"name": "direction", | ||
"type": "enum", | ||
"defaultValue": "horizontal", | ||
"options": [ | ||
{ | ||
"label": "vertical", | ||
"value": "vertical" | ||
}, | ||
{ | ||
"label": "horizontal", | ||
"value": "horizontal" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "size", | ||
"type": "enum", | ||
"defaultValue": "medium", | ||
"options": [ | ||
{ | ||
"label": "small", | ||
"value": "small" | ||
}, | ||
{ | ||
"label": "medium", | ||
"value": "medium" | ||
}, | ||
{ | ||
"label": "large", | ||
"value": "large" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule _common
updated
9 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import _Space from './space'; | ||
import withInstall from '../utils/withInstall'; | ||
|
||
import './style'; | ||
|
||
export * from './type'; | ||
|
||
export const Space = withInstall(_Space); | ||
|
||
export default Space; |
Oops, something went wrong.