mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
Merge branch 'develop' of ***REMOVED*** into develop
This commit is contained in:
commit
a007513395
@ -579,7 +579,14 @@ export default {
|
||||
:on-change="onChange"
|
||||
:search="search"
|
||||
:pagination="{ total: data.length, limit: 10 }"
|
||||
/>
|
||||
>
|
||||
<div slot="table-operation">
|
||||
custom
|
||||
</div>
|
||||
<div slot="table-operation-search-right">
|
||||
right custom
|
||||
</div>
|
||||
</n-advance-table>
|
||||
</div>
|
||||
<div class="n-doc-section__source">
|
||||
<textarea>
|
||||
@ -813,7 +820,19 @@ export default {
|
||||
}, {
|
||||
label: '15',
|
||||
value: 15
|
||||
}],
|
||||
}, {
|
||||
label: '16',
|
||||
value: 16
|
||||
}, {
|
||||
label: '17',
|
||||
value: 17
|
||||
}, {
|
||||
label: '18',
|
||||
value: 18
|
||||
}, {
|
||||
label: '19',
|
||||
value: 19
|
||||
} ],
|
||||
onFilter: (value, record) => {
|
||||
return value.includes(record.age)
|
||||
// switch (value) {
|
||||
|
@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<filterIcon :status="filterStatus">
|
||||
<ul class="n-table-filter-item">
|
||||
<!-- <n-scrollbar> -->
|
||||
<ul
|
||||
class="n-table-filter-item"
|
||||
>
|
||||
<li
|
||||
v-for="(item, idx) in items"
|
||||
:key="item.value"
|
||||
@ -15,6 +18,7 @@
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- </n-scrollbar> -->
|
||||
</filterIcon>
|
||||
</template>
|
||||
|
||||
@ -27,6 +31,10 @@ export default {
|
||||
filterIcon
|
||||
},
|
||||
props: {
|
||||
maxHeight: {
|
||||
type: [String, Number],
|
||||
default: 27 * 3
|
||||
},
|
||||
filterItems: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
@ -56,6 +64,14 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dropDownContent () {
|
||||
let stl = {}
|
||||
if (this.maxHeight !== 'unset') {
|
||||
let maxHeight = typeof this.maxHeight === 'string' ? this.maxHeight : this.maxHeight + 'px'
|
||||
stl.maxHeight = maxHeight
|
||||
}
|
||||
return stl
|
||||
},
|
||||
filterStatus () {
|
||||
return !!this.emitData
|
||||
},
|
||||
@ -144,12 +160,38 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .n-table-filter-item {
|
||||
|
||||
// &::-webkit-scrollbar {
|
||||
// width: 5px;
|
||||
// }
|
||||
// &::-webkit-scrollbar-track {
|
||||
// background: transparent;
|
||||
// }
|
||||
// &::-webkit-scrollbar-thumb {
|
||||
// background: rgba(255, 255, 255, 0.2);
|
||||
// border-radius: 2.5px;
|
||||
// }
|
||||
// &::-webkit-scrollbar-thumb:hover {
|
||||
// background: rgba(255, 255, 255, 0.3);
|
||||
// }
|
||||
// &::-webkit-scrollbar-corner {
|
||||
// background: transparent;
|
||||
// }
|
||||
// &::-webkit-scrollbar:horizontal {
|
||||
// height: 5px;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.n-table-filter-item {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-radius: 6px;
|
||||
/* overflow-y: scroll; */
|
||||
}
|
||||
.n-table-filter-item li:first-of-type {
|
||||
border-top-left-radius: 6px;
|
||||
|
@ -4,20 +4,27 @@
|
||||
class="n-advance-tabel__wrapper"
|
||||
>
|
||||
<div class="n-advance-table__operation">
|
||||
<section class="n-advance-table__operation__bacth" />
|
||||
<div class="n-advance-table__operation__custom">
|
||||
<slot name="table-operation" />
|
||||
<div class="n-advance-table__operation__left">
|
||||
<slot name="table-operation-batch-left" />
|
||||
<section class="n-advance-table__operation__bacth" />
|
||||
<slot name="table-operation-batch-right" />
|
||||
</div>
|
||||
<div
|
||||
v-if="search"
|
||||
class="n-advance-table__operation__search"
|
||||
class="n-advance-table__operation__right"
|
||||
:style="search?'margin-bottom: 18px;':''"
|
||||
>
|
||||
<searchInput
|
||||
ref="search"
|
||||
style=" margin-bottom: 18px;"
|
||||
:options="search"
|
||||
@on-change="handleSearch"
|
||||
/>
|
||||
<slot name="table-operation" />
|
||||
<div
|
||||
v-if="search"
|
||||
class="n-advance-table__operation__search"
|
||||
>
|
||||
<searchInput
|
||||
ref="search"
|
||||
:options="search"
|
||||
@on-change="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<slot name="table-operation-search-right" />
|
||||
</div>
|
||||
</div>
|
||||
<n-table
|
||||
@ -65,6 +72,7 @@
|
||||
<filterDropDown
|
||||
v-if="column.filterItems && !column.filterDropdown"
|
||||
:ref="'filterDropDown_' + (column.key || i)"
|
||||
:max-height="column.filterDropDownMaxHeight"
|
||||
:filter-fn="column.onFilter"
|
||||
:filter-key="column.key || i"
|
||||
:filter-items="column.filterItems"
|
||||
|
@ -63,7 +63,11 @@
|
||||
}
|
||||
.n-advance-table__operation {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content:space-between;
|
||||
}
|
||||
.n-advance-table__operation__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.n-no-data-tip {
|
||||
padding: 5px;
|
||||
|
Loading…
Reference in New Issue
Block a user