Files
workspace/code/g3soft-libs/docs/examples/drawer/size.vue
T
2026-10-09 22:05:02 +08:00

25 lines
974 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">
// 尺寸与可缩放: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 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">拖拽</G3Button>
</G3Space>
<G3Button @click="open = true">打开</G3Button>
<G3Drawer v-model:open="open" title="尺寸可配置" :width="width" :resizable="resizable" />
</G3Space>
</template>