这篇文章主要介绍了iview-admin中在table中使用Tooltip提示效果。

1. table中文字溢出隐藏,提示气泡展示所有信息

jLongText(item){
item.render = (h, params)=>{
// 处理文字,溢出用点代替
let txt = params.row[params.column.key]
let tableTxt = null
if(txt){
if(txt.length > item.longText){
tableTxt = txt.substring(0, item.longText) + '.....'
}else{
tableTxt = txt
}
} return h('Tooltip', {
props: {
placement: 'top'
}
},[
tableTxt,
h('span', {slot: 'content', style: {whiteSpace: 'normal', wordBreak: 'break-all'}}, txt)
])
}
return item
},
// style是 必须的,否则无法换行显示

2. Tooltip 折行显示效果

{
title: '状态监控',
align: 'center',
key: 'stat'
render: (h, params) => {
return h('Tooltip', {
props: {
placement: "right"
}
},[
stat,
[
h('p', { slot: 'content'},'CPU:11.1%'),
h('p', { slot: 'content'},'内存:5/12GB')
]
]);
}
}
// 使用多个标签实现多行显示,而不是换行

3. 单独使用Tooltip实现折行效果

<!-- 注意 Tooltip 内的文本使用了 white-space: nowrap;,即不自动换行,如需展示很多内容并自动换行时,建议给内容 slot 增加样式 white-space: normal; -->
<Tooltip :disabled="!msg">
<div slot="content" style="white-space:normal">{{msg}}</div>
<Input v-model="msg" />
</Tooltip>

iview的table中Tooltip的使用的更多相关文章

  1. iview之——table中嵌套input、select等

    使用iview在table中嵌入button是比较常见的需求,但是在table中嵌入input或者select你是否考虑过呢?本文用实例介绍input和select在table中的嵌套. 理解tabl ...

  2. 在iview的Table中添加Select(render)

    首先对Render进行分析,在iview官方的文档中,找到了table插入Button的例子: { title: 'Action', key: 'action', width: 150, align: ...

  3. IVIEW组件Table中加入EChart柱状图

    展示图如下: 主要利用了render函数和updated()钩子函数进行数据填充与渲染. 1.在Table的Colums中加入 1 { 2 title: '比例图', 3 align: 'center ...

  4. iview+vue 表格中添加图片

    开门见山,话不多说,要在表格中添加图片,可以使用td: <table " width="100%"> <tr class="tr-style ...

  5. iview的table组件中加入超链接组件,可编辑组件,选择组件,日期组件

    这篇文章主要介绍了iview的table组件中使用选择框,日期,可编辑表格,超链接等组件. 1.select选择组件 // tableColumn数组响应对象需要传入一个固定的option数组,如果该 ...

  6. iview table中的render函数使用

    1.表格列数据内容过多可以用以下两个属性解决: ellipsis:"true', tooltip:true 使每个列的内容如果过多的话变为省略号 2.table中的render函数(实现根据 ...

  7. [easyui] - 在easyui的table中展示提示框

    因为在easyui的table中字段过多,而无法展示全时,被迫只能使用这个方法. 使用方式: 在 $('#dg').datagrid({ 后的 queryParams: form2Json('sear ...

  8. iview在项目中遇到的坑

    1.下拉框选中某一项搜索发现总是搜不到,最后发现是选中后选中值后边莫名多了很长的空格,原因很简单,在代码中opction闭合标签和主体没有在一行. 2.iview+vue项目中,用百分比或者displ ...

  9. iview修改table组件实现循环向上滚屏

    前提,最近项目中需要实现table的滚屏效果,并且使用的是iview的table组件,踩坑,填坑如下. 1.首先找到Table组件中的table,就是这个class:ivu-table-body te ...

随机推荐

  1. Visual Studio 2019更新到16.2.2

    Visual Studio 2019更新到16.2.2 此次更新的变化有以下几点: (1)修复了Visual Studio在关闭时的停止响应问题.(2)修复CVE-2019-1211权限提升漏洞.(3 ...

  2. openresty开发系列4--nginx的配置文件说明

    openresty开发系列4--nginx的配置文件说明 Nginx基本配置 Nginx的主配置文件是:nginx.conf,nginx.conf主要组成如下: # 全局区   有一个工作子进程,一般 ...

  3. WPF ChromiumWebBrowser 网页背景透明

    网页中添加下面样式即可: <style> html, body { margin: 0px; height: %; width: %; overflow: hidden; backgrou ...

  4. Spring Boot 使用YAML配置

    YAML是JSON的一个超集,可以非常方便地将外部配置以层次结构形式存储起来.当项目的类路径中有SnakeYAML库(spring-boot-starter中已经被包含)时,SpringApplica ...

  5. LeetCode_344. Reverse String

    344. Reverse String Easy Write a function that reverses a string. The input string is given as an ar ...

  6. LeetCode_278. First Bad Version

    278. First Bad Version Easy You are a product manager and currently leading a team to develop a new ...

  7. 【Leetcode_easy】938. Range Sum of BST

    problem 938. Range Sum of BST 参考 1. Leetcode_easy_938. Range Sum of BST; 完

  8. 微信API V3 RESTFUL

    {"code":"SIGN_ERROR","message":"商户未设置加密的密钥,请登录商户平台操作!请参考http://kf ...

  9. 【GStreamer开发】GStreamer基础教程10——GStreamer工具

    目标 GStreamer提供了一系列方便使用的工具.这篇教程里不牵涉任何代码,但还是会讲一些有用的内容: 如何在命令行下建立一个pipeline--完全不使用C 如何找出一个element的Capab ...

  10. MangoDB

    <MongoDB权威指南> 一.简介 MongoDB是一款强大.灵活.且易于扩展的通用型数据库 1.易用性 MongoDB是一个面向文档(document-oriented)的数据库,而不 ...