31 lines
1.2 KiB
Vue
31 lines
1.2 KiB
Vue
<script setup lang="ts">
|
||
// 尺寸与可缩放:width / height 支持数字(px)或任意 CSS 长度;resizable 可关掉拖拽
|
||
import { ref } from 'vue'
|
||
import { G3Button, G3Drawer, G3Space } from '@g3soft/ui'
|
||
|
||
const open = ref(false)
|
||
const width = ref<number | string>(480)
|
||
const resizable = ref(true)
|
||
</script>
|
||
|
||
<template>
|
||
<G3Space direction="vertical" :size="12" style="display: flex">
|
||
<G3Space :size="8">
|
||
<G3Button size="small" type="outline" @click="width = 360">窄(360px)</G3Button>
|
||
<G3Button size="small" type="outline" @click="width = 640">宽(640px)</G3Button>
|
||
<G3Button size="small" type="outline" @click="width = '60%'">百分比(60%)</G3Button>
|
||
<G3Button size="small" type="ghost" @click="resizable = !resizable">
|
||
拖拽:{{ resizable ? '开' : '关' }}
|
||
</G3Button>
|
||
</G3Space>
|
||
|
||
<div>
|
||
<G3Button @click="open = true">打开(宽 {{ width }})</G3Button>
|
||
</div>
|
||
|
||
<G3Drawer v-model:open="open" title="尺寸可配置" :width="width" :resizable="resizable">
|
||
当前宽度:{{ width }}。拖拽左边缘时只会改变宽度,不会影响高度。
|
||
</G3Drawer>
|
||
</G3Space>
|
||
</template>
|