el-table-column疊加el-popover使用示例小結(jié)
需求:el-table-column有一列展示多個(gè)tag信息,實(shí)現(xiàn)點(diǎn)擊tag展示tag信息以及tag對應(yīng)的詳細(xì)信息
table的數(shù)據(jù)格式
data:[ { ..., isPopoverVisible:false, }, { ..., isPopoverVisible:false, }, ... ]
寫法:
<el-table-column label="配置信息" prop="listName"> <template slot-scope="scope"> <el-popover placement="bottom" title="配置信息以及對應(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)致頁面下拉框組件無法觸發(fā)彈框關(guān)閉(解決辦法)
在彈框觸發(fā)的方法里加上document.body.click() 即可
嘗試了很多其他的方法都沒用,只有這個(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="序號" 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)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- 使用element ui中el-table-column進(jìn)行自定義校驗(yàn)
- vue如何使用element ui表格el-table-column在里面做判斷
- Vue+ElementUI踩坑之動態(tài)顯示/隱藏表格的列el-table-column問題
- Vue element el-table-column中對日期進(jìn)行格式化方式(全局過濾器)
- vue中如何給el-table-column添加指定列的點(diǎn)擊事件
- 關(guān)于el-table-column的formatter的使用及說明
- el-table-column 內(nèi)容不自動換行的解決方法
- vue中el-table格式化el-table-column內(nèi)容的三種方法
- el-table el-table-column表頭嵌套循環(huán)數(shù)據(jù)的示例代碼
相關(guān)文章
vue 2.8.2版本配置剛進(jìn)入時(shí)候的默認(rèn)頁面方法
今天小編就為大家分享一篇vue 2.8.2版本配置剛進(jìn)入時(shí)候的默認(rèn)頁面方法,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-09-09五種Vue實(shí)現(xiàn)加減乘除運(yùn)算的方法總結(jié)
這篇文章主要為大家詳細(xì)介紹了五種Vue實(shí)現(xiàn)加減乘除運(yùn)算的方法,文中的示例代碼簡潔易懂,對我們深入了解vue有一定的幫助,需要的可以了解下2023-08-08vue使用Office?Web實(shí)現(xiàn)線上文件預(yù)覽
這篇文章主要為大家介紹了vue使用微軟的開發(fā)接口Office?Web,實(shí)現(xiàn)線上文件預(yù)覽,預(yù)覽word,excel,pptx,pdf文件,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-07-07vue導(dǎo)出excel的兩種實(shí)現(xiàn)方式代碼
這篇文章主要給大家介紹了關(guān)于vue導(dǎo)出excel的兩種實(shí)現(xiàn)方式,在項(xiàng)目中我們可能會碰到導(dǎo)出Excel文件的需求,文中給出了詳細(xì)的代碼示例,需要的朋友可以參考下2023-08-08vue使用exif獲取圖片旋轉(zhuǎn),壓縮的示例代碼
這篇文章主要介紹了vue使用exif獲取圖片旋轉(zhuǎn),壓縮的示例代碼,幫助大家更好的利用python處理圖片,感興趣的朋友可以了解下2020-12-12