mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
70 lines
1.5 KiB
Markdown
70 lines
1.5 KiB
Markdown
# Trigger Button
|
|
A trigger button, for free.
|
|
```html
|
|
<n-switch v-model="collapsed" />
|
|
<n-layout style="height: 240px;">
|
|
<n-layout-header style="height: 64px;">
|
|
Cool Header
|
|
</n-layout-header>
|
|
<n-layout>
|
|
<n-layout-sider
|
|
collapse-mode="width"
|
|
show-trigger
|
|
:collapsed-width="120"
|
|
:width="240"
|
|
:collapsed="collapsed"
|
|
@collapse="collapsed = true"
|
|
@expand="collapsed = false"
|
|
>
|
|
<n-h1>Sider</n-h1>
|
|
</n-layout-sider>
|
|
<n-layout style="padding: 24px;">
|
|
<n-layout-content>
|
|
<span>Content</span>
|
|
</n-layout-content>
|
|
<n-layout-footer>
|
|
<n-h1>Footer</n-h1>
|
|
</n-layout-footer>
|
|
</n-layout>
|
|
</n-layout>
|
|
</n-layout>
|
|
<n-layout style="height: 240px; overflow: hidden;">
|
|
<n-layout-header position="absolute" style="height: 64px;">
|
|
Cool Header
|
|
</n-layout-header>
|
|
<n-layout position="absolute" style="top: 64px;">
|
|
<n-layout-sider
|
|
position="absolute"
|
|
show-trigger
|
|
collapse-mode="transform"
|
|
:collapsed-width="120"
|
|
:width="240"
|
|
:collapsed="collapsed"
|
|
@collapse="collapsed = true"
|
|
@expand="collapsed = false"
|
|
>
|
|
<n-h1>Sider</n-h1>
|
|
</n-layout-sider>
|
|
<n-layout
|
|
position="absolute"
|
|
style="padding: 24px;"
|
|
>
|
|
<n-layout-content>
|
|
<span>Content</span>
|
|
</n-layout-content>
|
|
<n-layout-footer>
|
|
<n-h1>Footer</n-h1>
|
|
</n-layout-footer>
|
|
</n-layout>
|
|
</n-layout>
|
|
</n-layout>
|
|
```
|
|
```js
|
|
export default {
|
|
data () {
|
|
return {
|
|
collapsed: false
|
|
}
|
|
}
|
|
}
|
|
``` |