mirror of
https://github.com/element-plus/element-plus.git
synced 2025-08-14 18:11:48 +08:00

* docs(docs): [el-tooltip] Add example using append-to API * chore: del type --------- Co-authored-by: warmthsea <2586244885@qq.com>
27 lines
443 B
Vue
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>
|