u
This commit is contained in:
1 parent
f572dce2f6
commit
e99a9fb274
356 files changed
+28877
-1055
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
// 最基础:左右分栏。给了 defaultSize 的一侧固定,另一侧自动填充剩余空间
|
||||
import { ref } from 'vue'
|
||||
import { G3Splitter, G3SplitterPanel } from '@g3soft/ui'
|
||||
|
||||
const lastSizes = ref<number[]>([])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<G3Splitter
|
||||
style="height: 200px; border: 1px solid #d9d9d9; border-radius: 8px"
|
||||
@resize="(sizes: number[]) => (lastSizes = sizes)"
|
||||
>
|
||||
<G3SplitterPanel :default-size="240">
|
||||
<div class="pane">左侧 240px(可拖拽调整)</div>
|
||||
</G3SplitterPanel>
|
||||
<G3SplitterPanel>
|
||||
<div class="pane">右侧自动填充</div>
|
||||
</G3SplitterPanel>
|
||||
</G3Splitter>
|
||||
|
||||
<p style="margin: 8px 0 0; font-size: 12px; color: #6b7280">
|
||||
面板宽度:{{ lastSizes.join(' / ') || '(拖拽后显示)' }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.pane {
|
||||
padding: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
// min / max 限制拖拽范围(支持数字 px 或百分比字符串);resizable=false 的侧边不可被拖动
|
||||
import { G3Splitter, G3SplitterPanel, G3Switch, G3Space } from '@g3soft/ui'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const lockLeft = ref(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<G3Space direction="vertical" :size="12" style="display: flex">
|
||||
<G3Switch v-model="lockLeft">左侧不可拖动(resizable=false)</G3Switch>
|
||||
|
||||
<G3Splitter style="height: 200px; border: 1px solid #d9d9d9; border-radius: 8px">
|
||||
<G3SplitterPanel :min="160" :max="'50%'" :resizable="!lockLeft" :default-size="240">
|
||||
<div class="pane">左侧:最小 160px,最大 50%</div>
|
||||
</G3SplitterPanel>
|
||||
<G3SplitterPanel :min="200">
|
||||
<div class="pane">右侧:最小 200px</div>
|
||||
</G3SplitterPanel>
|
||||
</G3Splitter>
|
||||
|
||||
<p style="margin: 0; font-size: 12px; color: #6b7280">
|
||||
拖到边界会被钳制住;键盘用户可 Tab 聚焦分割线后用 ← → 调整(Shift 加速)
|
||||
</p>
|
||||
</G3Space>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.pane {
|
||||
padding: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
// 嵌套:外层左右分栏,右栏内部再上下分栏(经典 IDE 布局)
|
||||
import { G3Splitter, G3SplitterPanel } from '@g3soft/ui'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<G3Splitter style="height: 320px; border: 1px solid #d9d9d9; border-radius: 8px">
|
||||
<G3SplitterPanel :default-size="200">
|
||||
<div class="pane">侧栏(200px)</div>
|
||||
</G3SplitterPanel>
|
||||
|
||||
<G3SplitterPanel>
|
||||
<G3Splitter direction="vertical">
|
||||
<G3SplitterPanel>
|
||||
<div class="pane">编辑区</div>
|
||||
</G3SplitterPanel>
|
||||
<G3SplitterPanel :default-size="120">
|
||||
<div class="pane">输出 / 控制台(120px)</div>
|
||||
</G3SplitterPanel>
|
||||
</G3Splitter>
|
||||
</G3SplitterPanel>
|
||||
</G3Splitter>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.pane {
|
||||
padding: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
<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>
|
||||
Reference in new issue
Block a user