Skip to content

Commit 36d79a3

Browse files
committed
VueUiAccordion improved features
1 parent f5fb2cc commit 36d79a3

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "2.0.97",
4+
"version": "2.0.98",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/components/vue-ui-accordion.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function toggleDetails() {
3939
init.value += 1;
4040
}
4141
42+
const maxHeight = computed(() => {
43+
return `${accordionConfig.value.maxHeight}px`
44+
})
45+
4246
</script>
4347

4448
<template>
@@ -101,13 +105,13 @@ div.vue-ui-accordion-content {
101105
box-sizing: border-box;
102106
max-height: 0;
103107
overflow: hidden;
104-
padding: 0 10px;
105-
transition: max-height 400ms ease-out, border 0ms 400ms linear, opacity 400ms ease-out;
108+
transition: max-height 400ms ease-out, opacity 400ms ease-out;
106109
}
107110
108111
details[open]+div.vue-ui-accordion-content {
109-
max-height: 800px;
110-
transition: max-height 400ms ease-out, border 0ms linear, opacity 400ms ease-out;
112+
max-height: v-bind(maxHeight);
113+
overflow-y: auto;
114+
transition: max-height 1s ease-out, opacity 1s ease-out;
111115
opacity: 1;
112116
}
113117

src/default_configs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,6 +3640,7 @@
36403640
},
36413641
"vue_ui_accordion": {
36423642
"open": false,
3643+
"maxHeight": 2000,
36433644
"head": {
36443645
"useArrowSlot": false,
36453646
"backgroundColor": "#FFFFFF",

types/vue-data-ui.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,6 +4651,7 @@ declare module 'vue-data-ui' {
46514651

46524652
export type VueUiAccordionConfig = {
46534653
open?: boolean;
4654+
maxHeight: number;
46544655
head?: {
46554656
useArrowSlot?: boolean;
46564657
backgroundColor?: string;

0 commit comments

Comments
 (0)