tiny-vue/examples/sites/demos/pc/app/tooltip/popper-options-composition-...

18 lines
556 B
Vue
Raw Permalink 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.

<template>
<div>
<tiny-tooltip content="提示内容" :popper-options="options">
<button class="tiny-button tiny-button--primary">鼠标悬浮到这里</button>
</tiny-tooltip>
</div>
</template>
<script setup lang="jsx">
import { ref } from 'vue'
import { Tooltip as TinyTooltip } from '@opentiny/vue'
const options = ref({
bubbling: true, // 监听元素所有上级有滚动元素的scroll事件,防止弹出层与页面分离
removeOnDestroy: true // 弹出层消失后自动从页面上移除相应的DOM元素
})
</script>