el-table-column疊加el-popover使用示例小結(jié)
需求:el-table-column有一列展示多個(gè)tag信息,實(shí)現(xiàn)點(diǎn)擊tag展示tag信息以及tag對(duì)應(yīng)的詳細(xì)信息
table的數(shù)據(jù)格式
data:[
{
...,
isPopoverVisible:false,
},
{
...,
isPopoverVisible:false,
},
...
]寫(xiě)法:
<el-table-column label="配置信息" prop="listName">
<template slot-scope="scope">
<el-popover
placement="bottom"
title="配置信息以及對(duì)應(yīng)詳情"
trigger="manual"
v-model="scope.row.isPopoverVisible"
>
<el-cascader-panel :options="scope.row.CopyList"></el-cascader-panel>
<template slot="reference">
<div @click="scope.row.isPopoverVisible = !scope.row.isPopoverVisible" style="cursor: pointer;">
<div style="display: inline-block;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;width: 200px;">
<el-tag type="info" style="margin-right: 5px;" v-for="item in scope.row.tableList" :key="item.index">{{ item.dbName }}</el-tag>
</div>
</div>
</template>
</el-popover>
</template>
</el-table-column>實(shí)現(xiàn)了鼠標(biāo)控制懸浮數(shù)據(jù)的顯隱
擴(kuò)展:el-table某一列嵌套使用el-popover,使用click觸發(fā),導(dǎo)致頁(yè)面下拉框組件無(wú)法觸發(fā)彈框關(guān)閉(解決辦法)
在彈框觸發(fā)的方法里加上document.body.click() 即可
嘗試了很多其他的方法都沒(méi)用,只有這個(gè)解決了
完整代碼:
<el-select
@change="sourceChange"
clearable
>
<el-option
v-for="option in list1"
:key="option.code"
:label="option.name"
:value="option.code"
></el-option>
</el-select>
sourceChange(){
document.body.click()//重點(diǎn)
}
<el-table-column>
<template slot-scope="scope">
<el-popover
width="450"
:ref="`popover-${scope.row.id}`"
trigger="click"
@show="checkAllowed(scope.row)">
<span slot="reference" style="cursor: pointer;">
{{scope.row.name}}
</span>
<el-table
:data="List"
style="width: 100%"
row-key="id"
height="214px"
>
<el-table-column
label="序號(hào)"
width="45"
type="index"
></el-table-column>
</el-table>
</el-popover>
</template>
</el-table-column>到此這篇關(guān)于el-table-column疊加el-popover使用的文章就介紹到這了,更多相關(guān)el-table-column疊加el-popover使用內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- 使用element ui中el-table-column進(jìn)行自定義校驗(yàn)
- vue如何使用element ui表格el-table-column在里面做判斷
- Vue+ElementUI踩坑之動(dòng)態(tài)顯示/隱藏表格的列el-table-column問(wèn)題
- Vue element el-table-column中對(duì)日期進(jìn)行格式化方式(全局過(guò)濾器)
- vue中如何給el-table-column添加指定列的點(diǎn)擊事件
- 關(guān)于el-table-column的formatter的使用及說(shuō)明
- el-table-column 內(nèi)容不自動(dòng)換行的解決方法
- vue中el-table格式化el-table-column內(nèi)容的三種方法
- el-table el-table-column表頭嵌套循環(huán)數(shù)據(jù)的示例代碼
相關(guān)文章
VUE DEMO之模擬登錄個(gè)人中心頁(yè)面之間數(shù)據(jù)傳值實(shí)例
今天小編就為大家分享一篇VUE DEMO之模擬登錄個(gè)人中心頁(yè)面之間數(shù)據(jù)傳值實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-10-10
vue+axios 前端實(shí)現(xiàn)登錄攔截的兩種方式(路由攔截、http攔截)
本文通過(guò)實(shí)例代碼給大家介紹了vue+axios 前端實(shí)現(xiàn)登錄攔截的方法,主要通過(guò)路由攔截和http攔截,具體實(shí)例代碼大家跟隨小編一起通過(guò)本文學(xué)習(xí)吧2018-10-10
Vue實(shí)現(xiàn)阻止瀏覽器記住密碼功能的三種方法
本文主要介紹了Vue實(shí)現(xiàn)阻止瀏覽器記住密碼功能的三種方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2023-06-06
Intellij IDEA搭建vue-cli項(xiàng)目的方法步驟
這篇文章主要介紹了Intellij IDEA搭建vue-cli項(xiàng)目的方法步驟,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-10-10
vue2?自定義?el-radio-button?的樣式并設(shè)置默認(rèn)值的方法
這篇文章主要介紹了vue2?自定義?el-radio-button?的樣式并設(shè)置默認(rèn)值的操作方法,代碼分為html部分和css修改樣式代碼,代碼簡(jiǎn)單易懂,對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-10-10
Vue3+element實(shí)現(xiàn)表格數(shù)據(jù)導(dǎo)出
這篇文章主要為大家學(xué)習(xí)介紹了Vue3如何利用element實(shí)現(xiàn)表格數(shù)據(jù)導(dǎo)出功能,文中的示例代碼講解詳細(xì),感興趣的小伙伴快跟隨小編一起學(xué)習(xí)一下吧2023-07-07
Vue中通過(guò)屬性綁定為元素綁定style行內(nèi)樣式的實(shí)例代碼
這篇文章主要介紹了Vue中通過(guò)屬性綁定為元素綁定style行內(nèi)樣式,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-04-04
vue項(xiàng)目啟動(dòng)后沒(méi)有局域網(wǎng)地址問(wèn)題
這篇文章主要介紹了vue項(xiàng)目啟動(dòng)后沒(méi)有局域網(wǎng)地址問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-09-09

