Files
workspace/code/g3soft-libs/docs/examples/splitter/vertical.vue
T
2026-10-08 22:38:34 +08:00

35 lines
969 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// direction="vertical":上下分栏,此时用 defaultSize 控制高度
// barOnHover 默认 true:分割线只在 hover / 聚焦 / 拖拽时显示
import { G3Space, G3Splitter, G3SplitterPanel, G3Switch } from '@g3soft/ui'
import { ref } from 'vue'
const barOnHover = ref(true)
</script>
<template>
<G3Space direction="vertical" :size="12" style="display: flex">
<G3Switch v-model="barOnHover">分割线仅在 hover / 拖拽时显示</G3Switch>
<G3Splitter
direction="vertical"
:bar-on-hover="barOnHover"
style="height: 240px; border: 1px solid #d9d9d9; border-radius: 8px"
>
<G3SplitterPanel :default-size="120">
<div class="pane">上:120px</div>
</G3SplitterPanel>
<G3SplitterPanel>
<div class="pane">下:自动填充</div>
</G3SplitterPanel>
</G3Splitter>
</G3Space>
</template>
<style scoped>
.pane {
padding: 16px;
font-size: 13px;
}
</style>