u
This commit is contained in:
1 parent
e99a9fb274
commit
0be0b0767a
788 files changed
+112023
-14941
No files matched your search
@@ -1,22 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
// click 回传原生 MouseEvent:可以读修饰键,也可以阻止默认行为
|
||||
import { ref } from 'vue'
|
||||
// click 回传原生 MouseEvent
|
||||
import { G3Button, G3Space } from '@g3soft/ui'
|
||||
|
||||
const last = ref('暂无')
|
||||
|
||||
function handleClick(event: MouseEvent) {
|
||||
const withKey = event.ctrlKey || event.metaKey ? '(按住了 Ctrl/Cmd)' : ''
|
||||
last.value = `点击${withKey} @ ${event.clientX},${event.clientY}`
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<G3Space direction="vertical" :size="12" style="display: flex">
|
||||
<G3Space :size="8">
|
||||
<G3Button @click="handleClick">点我(可按住 Ctrl)</G3Button>
|
||||
<G3Button type="outline" @click="handleClick">也是点我</G3Button>
|
||||
</G3Space>
|
||||
<span style="color: #6b7280; font-size: 13px">最近一次:{{ last }}</span>
|
||||
<G3Space :size="8">
|
||||
<G3Button>点我(可按住 Ctrl)</G3Button>
|
||||
<G3Button type="outline">也是点我</G3Button>
|
||||
</G3Space>
|
||||
</template>
|
||||
Reference in new issue
Block a user