tiny-vue/examples/sites/demos/mobile-first/app/tooltip/z-index.vue

48 lines
1.2 KiB
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 class="h-[12.5rem] relative z-[100]">
<tiny-button @click="showTip">
{{ `点击${showTooltip ? '关闭' : '打开'}Tooltip` }}
</tiny-button>
<div class="relative top-20 left-[17.5rem]">
<tiny-tooltip
:manual="true"
v-model="showTooltip"
content="Tooltip组件属性zIndex值为relative弹出层样式属性zIndex值参考Reference及其父级Dom"
placement="top"
z-index="relative"
>
<tiny-button type="primary"> Reference </tiny-button>
</tiny-tooltip>
<tiny-tooltip
:manual="true"
v-model="showTooltip"
content="Tooltip组件属性zIndex为默认值next弹出层样式属性zIndex值由组件库内部维护"
placement="bottom"
>
<tiny-button type="primary"> Reference </tiny-button>
</tiny-tooltip>
</div>
</div>
</template>
<script>
import { Tooltip, Button } from '@opentiny/vue'
export default {
components: {
TinyTooltip: Tooltip,
TinyButton: Button
},
data() {
return {
showTooltip: false
}
},
methods: {
showTip() {
this.showTooltip = !this.showTooltip
}
}
}
</script>