Element Tooltip 文字提示的使用示例
编程学习 2021-07-04 14:06www.dzhlxh.cn编程入门
这篇文章主要介绍了Element Tooltip 文字提示的使用示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们狼蚁网站SEO优化随着长沙网络推广来一起学习学习吧
组件— 文字提示
基础用法
<div class="box"> <div class="top"> <el-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start"> <el-button>上左</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Top Center 提示文字" placement="top"> <el-button>上边</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Top Right 提示文字" placement="top-end"> <el-button>上右</el-button> </el-tooltip> </div> <div class="left"> <el-tooltip class="item" effect="dark" content="Left Top 提示文字" placement="left-start"> <el-button>左上</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Left Center 提示文字" placement="left"> <el-button>左边</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Left Bottom 提示文字" placement="left-end"> <el-button>左下</el-button> </el-tooltip> </div> <div class="right"> <el-tooltip class="item" effect="dark" content="Right Top 提示文字" placement="right-start"> <el-button>右上</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Right Center 提示文字" placement="right"> <el-button>右边</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Right Bottom 提示文字" placement="right-end"> <el-button>右下</el-button> </el-tooltip> </div> <div class="bottom"> <el-tooltip class="item" effect="dark" content="Bottom Left 提示文字" placement="bottom-start"> <el-button>下左</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Bottom Center 提示文字" placement="bottom"> <el-button>下边</el-button> </el-tooltip> <el-tooltip class="item" effect="dark" content="Bottom Right 提示文字" placement="bottom-end"> <el-button>下右</el-button> </el-tooltip> </div> </div> <style> .box { width: 400px; .top { text-align: center; } .left { float: left; width: 60px; } .right { float: right; width: 60px; } .bottom { clear: both; text-align: center; } .item { margin: 4px; } .left .el-tooltip__popper, .right .el-tooltip__popper { padding: 8px 10px; } } </style>
主题
<el-tooltip content="Top center" placement="top"> <el-button>Dark</el-button> </el-tooltip> <el-tooltip content="Bottom center" placement="bottom" effect="light"> <el-button>Light</el-button> </el-tooltip>
更多 Content
<el-tooltip placement="top"> <div slot="content">多行信息<br/>第二行信息</div> <el-button>Top center</el-button> </el-tooltip>
高级扩展
<template> <el-tooltip :disabled="disabled" content="点击关闭 tooltip 功能" placement="bottom" effect="light"> <el-button @click="disabled = !disabled">点击{{disabled ? '开启' : '关闭'}} tooltip 功能</el-button> </el-tooltip> </template> <script> export default { data() { return { disabled: false }; } }; </script>
Attributes
到此这篇关于Element Tooltip 文字提示的使用示例的文章就介绍到这了,更多相关Element Tooltip 文字提示内容请搜索狼蚁SEO以前的文章或继续浏览狼蚁网站SEO优化的相关文章希望大家以后多多支持狼蚁SEO!