element-plus/docs/examples/popover/basic-usage.vue
啝裳 87617892e9
docs: [el-popover] add trigger=contextmenubefore-enterbefore-leave (#6108)
* docs: [el-popover] add before-enter、before-leave

* docs: [el-popover] add `trigger=contextmenu`

* docs: update
2022-02-21 17:10:55 +08:00

69 lines
1.5 KiB
Vue

<template>
<el-popover
placement="top-start"
title="Title"
:width="200"
trigger="hover"
content="this is content, this is content, this is content"
>
<template #reference>
<el-button>Hover to activate</el-button>
</template>
</el-popover>
<el-popover
placement="bottom"
title="Title"
:width="200"
trigger="click"
content="this is content, this is content, this is content"
>
<template #reference>
<el-button>Click to activate</el-button>
</template>
</el-popover>
<el-popover
ref="popover"
placement="right"
title="Title"
:width="200"
trigger="focus"
content="this is content, this is content, this is content"
>
<template #reference>
<el-button>Focus to activate</el-button>
</template>
</el-popover>
<el-popover
ref="popover"
title="Title"
:width="200"
trigger="contextmenu"
content="this is content, this is content, this is content"
>
<template #reference>
<el-button>contextmenu to activate</el-button>
</template>
</el-popover>
<el-popover
v-model:visible="visible"
placement="bottom"
title="Title"
:width="200"
content="this is content, this is content, this is content"
>
<template #reference>
<el-button @click="visible = !visible">Manual to activate</el-button>
</template>
</el-popover>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const visible = ref(false)
</script>