-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
109 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,66 @@ | ||
# 树 tree | ||
# Tree | ||
|
||
## 用法 | ||
## 基础使用 | ||
|
||
### 基础使用 | ||
|
||
<a-rate v-model="rateVal" /> | ||
<a-tree :data="treeVal" show-checkbox></a-tree> | ||
|
||
```vue | ||
<template> | ||
<a-rate v-model="rateVal" /> | ||
<a-tree :data="treeVal" show-checkbox></a-tree> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
const rateVal = ref(2); | ||
</script> | ||
``` | ||
|
||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
const rateVal = ref(2); | ||
</script> | ||
|
||
## API | ||
|
||
### props | ||
## 属性 | ||
|
||
| 名称 | 类型 | 可选值 | 默认值 | 说明 | | ||
| -------------------- | ------------- | ------ | ------ | ------ | | ||
| modelValue / v-model | string/number | - | - | 绑定值 | | ||
| disabled | boolean | - | false | 禁用 | | ||
|
||
### 事件 | ||
## 事件 | ||
|
||
| 名称 | 说明 | 参数 | | ||
| ------ | ---- | ---- | | ||
| change | - | - | | ||
|
||
<script lang="ts" setup> | ||
import { reactive } from "vue"; | ||
const treeVal = reactive([ | ||
{ | ||
title: 'parent 1', | ||
expand: true, | ||
checked: false, | ||
children: [ | ||
{ | ||
title: 'parent 1-1', | ||
expand: true, | ||
checked: false, | ||
children: [ | ||
{ | ||
title: 'leaf 1-1-1', | ||
checked: false | ||
}, | ||
{ | ||
title: 'leaf 1-1-2', | ||
checked: false | ||
} | ||
] | ||
}, | ||
{ | ||
title: 'parent 1-2', | ||
checked: false, | ||
children: [ | ||
{ | ||
title: 'leaf 1-2-1', | ||
checked: false | ||
}, | ||
{ | ||
title: 'leaf 1-2-1', | ||
checked: false | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]); | ||
</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
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,19 @@ | ||
<template> | ||
<i class="a-icon"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
viewBox="0 0 512 512" | ||
> | ||
<path | ||
d="M98 190.06l139.78 163.12a24 24 0 0 0 36.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z" | ||
fill="currentColor" | ||
></path> | ||
</svg> | ||
</i> | ||
</template> | ||
<script lang="ts"> | ||
export default { | ||
name: 'AIconCaretDown' | ||
}; | ||
</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,19 @@ | ||
<template> | ||
<i class="a-icon"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
viewBox="0 0 512 512" | ||
> | ||
<path | ||
d="M190.06 414l163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z" | ||
fill="currentColor" | ||
></path> | ||
</svg> | ||
</i> | ||
</template> | ||
<script lang="ts"> | ||
export default { | ||
name: 'AIconCaretForWard' | ||
}; | ||
</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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export { default as AIconClose } from './close.vue'; | ||
|
||
export { default as AIconCaretDown } from './caret-down.vue'; | ||
|
||
export { default as AIconCaretForWard } from './caret-forward.vue'; |
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 |
---|---|---|
|
@@ -6,3 +6,7 @@ | |
.tree-expand { | ||
cursor: pointer; | ||
} | ||
|
||
.tree-expand .a-icon { | ||
@apply w-4 h-4; | ||
} |