Files
Spaceman 241a22414c docs(components): [el-tooltip] add example using append-to API (#19943)
* docs(docs): [el-tooltip] Add example using append-to API

* chore: del type

---------

Co-authored-by: warmthsea <2586244885@qq.com>
2025-02-28 18:02:11 +08:00

27 lines
443 B
Vue

<template>
<el-tooltip
:append-to="targetElement"
trigger="click"
content="Append to .target"
placement="top"
>
<el-button class="target">Click to open tooltip</el-button>
</el-tooltip>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
const targetElement = ref('')
onMounted(() => {
targetElement.value = '.target'
})
</script>
<style scoped>
.target {
position: relative;
}
</style>