mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-20 22:48:58 +08:00
- Updated demo-preview and preview-group components for better error handling and layout. - Enhanced drawer and modal components for improved auto-height functionality. - Refactored layout components including header, footer, sidebar, and tabbar for better responsiveness and usability. - Adjusted tooltip and help tooltip components for better user guidance. - Fixed issues in various UI components to ensure consistent styling and functionality across the application.
46 lines
977 B
Vue
46 lines
977 B
Vue
<script lang="ts" setup>
|
|
import { ref } from 'vue';
|
|
|
|
import { useVbenDrawer, VbenButton } from '@vben/common-ui';
|
|
|
|
const list = ref<number[]>([]);
|
|
|
|
const [Drawer, drawerApi] = useVbenDrawer({
|
|
onCancel() {
|
|
drawerApi.close();
|
|
},
|
|
onConfirm() {
|
|
console.log('onConfirm');
|
|
},
|
|
onOpenChange(isOpen) {
|
|
if (isOpen) {
|
|
handleUpdate(10);
|
|
}
|
|
},
|
|
});
|
|
|
|
function handleUpdate(len: number) {
|
|
drawerApi.setState({ loading: true });
|
|
setTimeout(() => {
|
|
list.value = Array.from({ length: len }, (_v, k) => k + 1);
|
|
drawerApi.setState({ loading: false });
|
|
}, 2000);
|
|
}
|
|
</script>
|
|
<template>
|
|
<Drawer title="自动计算高度">
|
|
<div
|
|
v-for="item in list"
|
|
:key="item"
|
|
class="flex-center h-[220px] w-full bg-muted even:bg-heavy"
|
|
>
|
|
{{ item }}
|
|
</div>
|
|
<template #prepend-footer>
|
|
<VbenButton type="link" @click="handleUpdate(6)">
|
|
点击更新数据
|
|
</VbenButton>
|
|
</template>
|
|
</Drawer>
|
|
</template>
|