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

28 lines
798 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">
// #icon 插槽放图标;纯图标按钮用 type="icon",并补 aria-label
import { G3Button, G3Space } from '@g3soft/ui'
import { Plus, Search, Trash2 } from '@lucide/vue'
</script>
<template>
<G3Space :size="[12, 12]" align="center" wrap>
<G3Button>
<template #icon><Plus /></template>
新增
</G3Button>
<!-- 纯图标按钮:没有文字,必须给 aria-label -->
<G3Button type="icon" aria-label="搜索">
<template #icon><Search /></template>
</G3Button>
<G3Button type="icon" size="small" aria-label="删除">
<template #icon><Trash2 /></template>
</G3Button>
<G3Button type="icon" size="large" aria-label="新增">
<template #icon><Plus /></template>
</G3Button>
</G3Space>
</template>