Files
element-plus/docs/examples/tooltip/basic.vue
Zachary Bear 8de357ca9a docs(components): [tooltip] optimized basic example (#23756)
* perf(docs): [tooltip] optimized basic example

The `left-*` and `right-*` example are showing single line content,
so user wouldn't see what's the difference between them.

Now I changed them to multiline content.

* style(docs): [tooltip] improve documentation for clarity and consistency

* docs(components): [tooltip] fixed typos

* docs(components): [tooltip] removed leftover prop

* Update docs/examples/tooltip/basic.vue

---------

Co-authored-by: rzzf <cszhjh@gmail.com>
2026-03-09 08:25:40 +00:00

129 lines
3.1 KiB
Vue

<template>
<div class="tooltip-base-box">
<div class="row center">
<el-tooltip
class="box-item"
effect="dark"
content="Top Left prompts info"
placement="top-start"
>
<el-button>top-start</el-button>
</el-tooltip>
<el-tooltip
class="box-item"
effect="dark"
content="Top Center prompts info"
placement="top"
>
<el-button>top</el-button>
</el-tooltip>
<el-tooltip
class="box-item"
effect="dark"
content="Top Right prompts info"
placement="top-end"
>
<el-button>top-end</el-button>
</el-tooltip>
</div>
<div class="row">
<el-tooltip class="box-item" effect="dark" placement="left-start">
<template #content>
Left Top
<br />
prompts info
</template>
<el-button>left-start</el-button>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" placement="right-start">
<template #content>
Right Top
<br />
prompts info
</template>
<el-button>right-start</el-button>
</el-tooltip>
</div>
<div class="row">
<el-tooltip class="box-item" effect="dark" placement="left">
<template #content>
Left Center
<br />
prompts info
</template>
<el-button class="mt-3 mb-3">left</el-button>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" placement="right">
<template #content>
Right Center
<br />
prompts info
</template>
<el-button>right</el-button>
</el-tooltip>
</div>
<div class="row">
<el-tooltip class="box-item" effect="dark" placement="left-end">
<template #content>
Left Bottom
<br />
prompts info
</template>
<el-button>left-end</el-button>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" placement="right-end">
<template #content>
Right Bottom
<br />
prompts info
</template>
<el-button>right-end</el-button>
</el-tooltip>
</div>
<div class="row center">
<el-tooltip
class="box-item"
effect="dark"
content="Bottom Left prompts info"
placement="bottom-start"
>
<el-button>bottom-start</el-button>
</el-tooltip>
<el-tooltip
class="box-item"
effect="dark"
content="Bottom Center prompts info"
placement="bottom"
>
<el-button>bottom</el-button>
</el-tooltip>
<el-tooltip
class="box-item"
effect="dark"
content="Bottom Right prompts info"
placement="bottom-end"
>
<el-button>bottom-end</el-button>
</el-tooltip>
</div>
</div>
</template>
<style>
.tooltip-base-box {
width: 600px;
}
.tooltip-base-box .row {
display: flex;
align-items: center;
justify-content: space-between;
}
.tooltip-base-box .center {
justify-content: center;
}
.tooltip-base-box .box-item {
width: 110px;
margin-top: 10px;
}
</style>