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

24 lines
723 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">
// trigger:click(默认)/ hover(下拉菜单栏)/ contextmenu(右键,常用于表格行 / 树节点)
import { G3Button, G3Dropdown, G3Space } from '@g3soft/ui'
const items = [
{ key: 'open', label: '打开' },
{ key: 'rename', label: '重命名' },
]
</script>
<template>
<G3Space :size="[16, 12]" align="center" wrap>
<G3Dropdown :items="items" trigger="hover">
<G3Button type="outline">hover 触发</G3Button>
</G3Dropdown>
<G3Dropdown :items="items" trigger="contextmenu" :offset="2">
<div style="padding: 10px 20px; border: 1px dashed #d9d9d9; border-radius: 6px">
在此处右键
</div>
</G3Dropdown>
</G3Space>
</template>