Skip to content

Commit

Permalink
📃 docs: 增加组件 link 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoJikun committed Nov 21, 2023
1 parent c1a52c5 commit 2022c67
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 39 deletions.
5 changes: 4 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
"ivy-drawer",
"ivy-tooltip",
"ivy-details",
"ivy-tree"
"ivy-tree",
"ivy-link",
"ivy-tag",
"ivy-text"
]
}
}
File renamed without changes.
86 changes: 48 additions & 38 deletions packages/docs/src/.vitepress/config/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,58 @@ const guide = [
},
];

const basic = [
{
text: "Icon 图标",
link: "/components/icon",
},
{
text: "Button 按钮",
link: "/components/button",
},
{
text: "Space 间距",
link: "/components/space",
},
{
text: "Grid 宫格布局",
link: "/components/grid-layout.md",
},
{
text: "Row/Col 栅格",
link: "/components/grid",
},
{
text: "Split 分割面板",
link: "/components/split",
},
{
text: "Divider 分割线",
link: "/components/divider",
},
{
text: "AspectRatio 比例容器",
link: "/components/aspect-ratio",
},
{
text: "Scrollbar 滚动条",
link: "/components/scrollbar",
},
{
text: "Link 链接",
link: "/components/link",
},
{
text: "Text 文字",
link: "/components/text",
},
];

const components = [
{
text: "基础/布局",
collapsible: true,
items: [
{
text: "Icon 图标",
link: "/components/icon",
},
{
text: "Button 按钮",
link: "/components/button",
},
{
text: "Space 间距",
link: "/components/space",
},
{
text: "Grid 宫格布局",
link: "/components/grid-layout.md",
},
{
text: "Row/Col 栅格",
link: "/components/grid",
},
{
text: "Split 分割面板",
link: "/components/split",
},
{
text: "Divider 分割线",
link: "/components/divider",
},
{
text: "AspectRatio 比例容器",
link: "/components/aspect-ratio",
},
{
text: "Scrollbar 滚动条",
link: "/components/scrollbar",
},
],
items: basic,
},
{
text: "表单",
Expand Down
43 changes: 43 additions & 0 deletions packages/docs/src/components/link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Link 链接

文字超链接

## 基础用法

基础的文字链接用法。

<ivy-link href="https://www.baidu.com">default</ivy-link>
<ivy-link type="primary" class="margin-left">primary</ivy-link>
<ivy-link type="success" class="margin-left">success</ivy-link>
<ivy-link type="warning" class="margin-left">warning</ivy-link>
<ivy-link type="danger" class="margin-left">danger</ivy-link>
<ivy-link type="info" class="margin-left">info</ivy-link>

## 禁用状态

文字链接不可用状态。

<ivy-link href="https://www.baidu.com" disabled>default</ivy-link>
<ivy-link type="primary" disabled class="margin-left">primary</ivy-link>
<ivy-link type="success" disabled class="margin-left">success</ivy-link>
<ivy-link type="warning" disabled class="margin-left">warning</ivy-link>
<ivy-link type="danger" disabled class="margin-left">danger</ivy-link>
<ivy-link type="info" disabled class="margin-left">info</ivy-link>

## 显示下划线

<ivy-link href="https://www.baidu.com" underline>default</ivy-link>
<ivy-link type="primary" underline class="margin-left">primary</ivy-link>
<ivy-link type="success" underline class="margin-left">success</ivy-link>
<ivy-link type="warning" underline class="margin-left">warning</ivy-link>
<ivy-link type="danger" underline class="margin-left">danger</ivy-link>
<ivy-link type="info" underline class="margin-left">info</ivy-link>

## Props

| 属性名 | 说明 | 类型 | 可选值 | 默认值 |
| --------- | ---------------- | --------- | ------------------------------------- | ------ |
| type | 类型 | `string` | `primary/success/warning/danger/info` | - |
| disabled | 禁用 | `boolean` | - | - |
| underline | 下划线 | `boolean` | - | - |
| href | 同 a 标签的 href | `string` | - | - |

0 comments on commit 2022c67

Please sign in to comment.