File tree Expand file tree Collapse file tree 8 files changed +38
-10
lines changed Expand file tree Collapse file tree 8 files changed +38
-10
lines changed Original file line number Diff line number Diff line change 38
38
- ` n-cascader ` filter ignore case sensitive.
39
39
- ` n-data-table ` adds ` allowExport ` prop for column.
40
40
- ` n-date-picker ` adds ` year-range ` prop.
41
+ - ` n-tree-select ` adds ` header ` slot, closes [ #5915 ] ( https://github.com/tusen-ai/naive-ui/issues/5915 ) .
41
42
42
43
## 2.39.0
43
44
Original file line number Diff line number Diff line change 38
38
- ` n-cascader ` 过滤算法忽略大小写
39
39
- ` n-data-table ` 在列的配置中新增 ` allowExport ` 属性
40
40
- ` n-date-picker ` 新增 ` year-range ` 属性
41
+ - ` n-tree-select ` 新增 ` header ` 插槽,关闭 [ #5915 ] ( https://github.com/tusen-ai/naive-ui/issues/5915 )
41
42
42
43
## 2.39.0
43
44
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ export default defineComponent({
92
92
default-value =" Drive My Car"
93
93
@update:value =" handleUpdateValue"
94
94
>
95
+ <template #header >
96
+ Don't know what to put
97
+ </template >
95
98
<template #action >
96
99
You can customize some operations here.
97
100
</template >
Original file line number Diff line number Diff line change @@ -86,11 +86,12 @@ debug.vue
86
86
87
87
### TreeSelect Slots
88
88
89
- | Name | Parameters | Description | Version |
90
- | ------ | ---------- | -------------------------------------- | ------- |
91
- | action | ` () ` | Options menu slot. | 2.22.0 |
92
- | arrow | ` () ` | Arrow icon of trigger. | 2.30.4 |
93
- | empty | ` () ` | Empty state slot for the options menu. | 2.22.0 |
89
+ | Name | Parameters | Description | Version |
90
+ | ------ | ---------- | -------------------------------------- | ------------ |
91
+ | header | ` () ` | Header menu slot. | NEXT_VERSION |
92
+ | action | ` () ` | Options menu slot. | 2.22.0 |
93
+ | arrow | ` () ` | Arrow icon of trigger. | 2.30.4 |
94
+ | empty | ` () ` | Empty state slot for the options menu. | 2.22.0 |
94
95
95
96
### TreeSelect Methods
96
97
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ export default defineComponent({
92
92
default-value =" Drive My Car"
93
93
@update:value =" handleUpdateValue"
94
94
>
95
+ <template #header >
96
+ 不知道放些什么
97
+ </template >
95
98
<template #action >
96
99
你可以在这里自定义一些操作
97
100
</template >
Original file line number Diff line number Diff line change @@ -89,11 +89,12 @@ render-debug.vue
89
89
90
90
### TreeSelect Slots
91
91
92
- | 名称 | 参数 | 说明 | 版本 |
93
- | ------ | ---- | ------------------- | ------ |
94
- | action | ` () ` | 菜单操作区域的 slot | 2.22.0 |
95
- | arrow | ` () ` | 选择箭头 slot | 2.30.4 |
96
- | empty | ` () ` | 菜单无数据时的 slot | 2.22.0 |
92
+ | 名称 | 参数 | 说明 | 版本 |
93
+ | ------ | ---- | ------------------- | ------------ |
94
+ | header | ` () ` | 菜单头部区域的 slot | NEXT_VERSION |
95
+ | action | ` () ` | 菜单操作区域的 slot | 2.22.0 |
96
+ | arrow | ` () ` | 选择箭头 slot | 2.30.4 |
97
+ | empty | ` () ` | 菜单无数据时的 slot | 2.22.0 |
97
98
98
99
### TreeSelect Methods
99
100
Original file line number Diff line number Diff line change @@ -969,6 +969,16 @@ export default defineComponent({
969
969
onFocusin = { this . handleMenuFocusin }
970
970
onFocusout = { this . handleMenuFocusout }
971
971
>
972
+ { resolveWrappedSlot ( $slots . header , ( children ) => {
973
+ return children ? (
974
+ < div
975
+ class = { `${ mergedClsPrefix } -tree-select-menu__header` }
976
+ data-action
977
+ >
978
+ { children }
979
+ </ div >
980
+ ) : null
981
+ } ) }
972
982
< NTree
973
983
ref = "treeInstRef"
974
984
blockLine
Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ export default c([
34
34
flex: 1;
35
35
justify-content: center;
36
36
` ) ,
37
+ cE ( 'header' , `
38
+ padding: var(--n-action-padding);
39
+ transition:
40
+ color .3s var(--n-bezier);
41
+ border-color .3s var(--n-bezier);
42
+ border-bottom: 1px solid var(--n-action-divider-color);
43
+ color: var(--n-action-text-color);
44
+ ` ) ,
37
45
cE ( 'action' , `
38
46
padding: var(--n-action-padding);
39
47
transition:
You can’t perform that action at this time.
0 commit comments