iview的table中Tooltip的使用
这篇文章主要介绍了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的使用的更多相关文章
- iview之——table中嵌套input、select等
使用iview在table中嵌入button是比较常见的需求,但是在table中嵌入input或者select你是否考虑过呢?本文用实例介绍input和select在table中的嵌套. 理解tabl ...
- 在iview的Table中添加Select(render)
首先对Render进行分析,在iview官方的文档中,找到了table插入Button的例子: { title: 'Action', key: 'action', width: 150, align: ...
- IVIEW组件Table中加入EChart柱状图
展示图如下: 主要利用了render函数和updated()钩子函数进行数据填充与渲染. 1.在Table的Colums中加入 1 { 2 title: '比例图', 3 align: 'center ...
- iview+vue 表格中添加图片
开门见山,话不多说,要在表格中添加图片,可以使用td: <table " width="100%"> <tr class="tr-style ...
- iview的table组件中加入超链接组件,可编辑组件,选择组件,日期组件
这篇文章主要介绍了iview的table组件中使用选择框,日期,可编辑表格,超链接等组件. 1.select选择组件 // tableColumn数组响应对象需要传入一个固定的option数组,如果该 ...
- iview table中的render函数使用
1.表格列数据内容过多可以用以下两个属性解决: ellipsis:"true', tooltip:true 使每个列的内容如果过多的话变为省略号 2.table中的render函数(实现根据 ...
- [easyui] - 在easyui的table中展示提示框
因为在easyui的table中字段过多,而无法展示全时,被迫只能使用这个方法. 使用方式: 在 $('#dg').datagrid({ 后的 queryParams: form2Json('sear ...
- iview在项目中遇到的坑
1.下拉框选中某一项搜索发现总是搜不到,最后发现是选中后选中值后边莫名多了很长的空格,原因很简单,在代码中opction闭合标签和主体没有在一行. 2.iview+vue项目中,用百分比或者displ ...
- iview修改table组件实现循环向上滚屏
前提,最近项目中需要实现table的滚屏效果,并且使用的是iview的table组件,踩坑,填坑如下. 1.首先找到Table组件中的table,就是这个class:ivu-table-body te ...
随机推荐
- 006 GET API
1.说明 The get API allows to get a JSON document from the index based on its id. GET通过基于id的索引获取JSON文档. ...
- hyper-v启动虚拟机时提示“The application encountered an error while attempting to change the state of the machine ‘虚拟机名称'”如何处理?
1. 找出发生这一问题的事件代号 1.1 在开始菜单中搜索程序Event Viewer并点击进入 1.2 点击路径如下: “Applications and Services Logs > Mi ...
- VS2019及其他多个版本序列号和安装包
Visual Studio2019序列号Visual Studio 2019 EnterpriseBF8Y8-GN2QH-T84XB-QVY3B-RC4DFVisual Studio 2019 Pro ...
- fkutter Stepper步骤指示器
一个Material Design 步骤指示器,显示一系列步骤的过程 import 'package:flutter/material.dart'; class StepperDemo extends ...
- 忏悔言情小说带来的意淫以及对治方法 (转自学佛网:http://www.xuefo.net/nr/article55/554935.html)
小时候,因为父母经常吵架,我觉得很孤独,一个人经常孤零零的,就喜欢一个人看书,大人的书难免里面有情情爱爱的内容,结果就很喜欢里面的深情的爱情故事,总是幻想自己有一段爱情.其实就是意淫的开始,所以后来学 ...
- Vue cli4.0 代理配置
proxy: { '/service': { target: 'http://192.168.40.243:3000/', //对应自己的接口 changeOrigin: true, ws: true ...
- 给APK签名,修改签名
简介: 本来是不需要签名的,但是我有个android的专用设备,限制安装,但是售后给我通过了一个证书的验证. 那么我想装什么软件,就需要这个证书验证. 现在记录一下签名的主要过程,还有修改签名的方法. ...
- numpy包中,与线性代数相关的模块——linalg(利那隔)
https://github.com/scalanlp/breeze/wiki/Linear-Algebra-Cheat-Sheethttps://docs.scipy.org/doc/numpy-1 ...
- realloc(void *__ptr, size_t __size)
#include <stdlib.h>realloc(void *__ptr, size_t __size):更改已经配置的内存空间,即更改由malloc()函数分配的内存空间的大小.如果 ...
- 随机采样一致算法RANSAC
A project to learn line, circle and ellipse detection in 2d images: https://github.com/Yiphy/Ransac- ...