Skip to content

Commit 3b39b5a

Browse files
committed
feat: add horizontal collapse
1 parent 3ac510e commit 3b39b5a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/views/base/Collapses.vue

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,39 @@
3232
</DocsExample>
3333
</CCardBody>
3434
</CCard>
35+
<CCard class="mb-4">
36+
<CCardHeader>
37+
<strong>Vue Collapse</strong> <small> Horizontal</small>
38+
</CCardHeader>
39+
<CCardBody>
40+
<p class="text-medium-emphasis small">
41+
The collapse plugin also supports horizontal collapsing. Add the
42+
<code>horizontal</code> property to transition the
43+
<code>width</code> instead of <code>height</code> and set a
44+
<code>width</code> on the immediate child element.
45+
</p>
46+
<DocsExample href="components/collapse.html#horizontal">
47+
<CButton
48+
class="mb-3"
49+
color="primary"
50+
aria-expanded="{visible}"
51+
aria-controls="collapseWidthExample"
52+
@click="visibleHorizontal = !visibleHorizontal"
53+
>Button</CButton
54+
>
55+
<div style="min-height: 120px">
56+
<CCollapse horizontal :visible="visibleHorizontal">
57+
<CCard style="width: 300px">
58+
<CCardBody>
59+
This is some placeholder content for a horizontal collapse.
60+
It's hidden by default and shown when triggered.
61+
</CCardBody>
62+
</CCard>
63+
</CCollapse>
64+
</div>
65+
</DocsExample>
66+
</CCardBody>
67+
</CCard>
3568
<CCard class="mb-4">
3669
<CCardHeader>
3770
<strong>Vue Collapse</strong> <small> multi target</small>
@@ -100,10 +133,12 @@ export default {
100133
const visible = ref(false)
101134
const visibleA = ref(false)
102135
const visibleB = ref(false)
136+
const visibleHorizontal = ref(false)
103137
return {
104138
visible,
105139
visibleA,
106140
visibleB,
141+
visibleHorizontal,
107142
}
108143
},
109144
}

0 commit comments

Comments
 (0)