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

26 lines
776 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">
// 包裹模式:spinning 为 true 时给内容加半透明遮罩 + 居中指示器
import { ref } from 'vue'
import { G3Button, G3Spin, G3Space } from '@g3soft/ui'
const loading = ref(false)
async function reload() {
loading.value = true
await new Promise((resolve) => setTimeout(resolve, 1200))
loading.value = false
}
</script>
<template>
<G3Space direction="vertical" :size="12" style="display: flex">
<G3Button type="outline" size="small" @click="reload">重新加载</G3Button>
<G3Spin :spinning="loading">
<div style="padding: 24px; border: 1px solid #d9d9d9; border-radius: 8px">
被包裹的内容区域:加载中会被遮罩覆盖,并阻止点击。
</div>
</G3Spin>
</G3Space>
</template>