網站首頁 編程語言 正文
?
?
?具體代碼
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title></title>
<link >
<style>
.item:hover {
color: #ff8040;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
<el-table :data="tableData" border style="width: 50%">
<el-table-column fixed prop="date" label="日期" width="150">
</el-table-column>
<el-table-column prop="name" label="姓名" width="120">
</el-table-column>
<el-table-column prop="province" label="省份" width="120">
<template slot-scope="scope">
<div v-for="(item1,index1) in scope.row.children" :key="index1">
<el-popover placement="top" width="160" :ref="`popover-${scope.$index}${index1}`">
<p>這是一段內容這是一段內容確定刪除嗎?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancel(`popover-${scope.$index}${index1}`,item1)">取消
</el-button>
<el-button type="primary" size="mini" @click="confirm(`popover-${scope.$index}${index1}`,item1)">確定
</el-button>
</div>
<div slot="reference" class="item">{{item1}}點擊彈窗</div>
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column prop="city" label="市區" width="120">
</el-table-column>
<el-table-column prop="address" label="地址" width="300">
</el-table-column>
<el-table-column prop="zip" label="郵編" width="120">
</el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
<el-button type="text" size="small">編輯</el-button>
</template>
</el-table-column>
</el-table>
</div>
<script>
var vm = new Vue({
el: '#app',
data: function () {
return {
visible: false,
tableData: [
{
"id": 45,
"children": [
5,
5,
5
],
},
{
"id": 50,
"children": [
35,
2
],
},
{
"id": 51,
"children": [
7,
3
],
},
{
"id": 53,
"children": [
4,
3
],
},
{
"id": 55,
"children": [
2,
5,
1,
5
],
},
{
"id": 57,
"children": [
2,
3
],
},
]
}
},
methods: {
cancel(e, item1) {
let arr = this.$refs[e]
//這邊不太清楚為什么獲取到的節點會是一個數組集合,索性直接循環一遍,每一個都執行doClose關閉彈窗方法
arr.forEach((item, index) => {
this.$refs[e][index].doClose()
});
},
confirm(e, item1) {
let arr = this.$refs[e]
arr.forEach((item, index) => {
this.$refs[e][index].doClose()
});
console.log(item1);
},
handleClick(row) {
console.log(row);
}
},
})
</script>
</body>
</html>
原文鏈接:https://blog.csdn.net/weixin_43923808/article/details/131856369
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-07-14 Android實現多點觸控功能_Android
- 2022-03-15 在Linux+Jexus中發布和部署Asp.Net?Core_自學過程
- 2023-10-31 IP地址、網關、網絡/主機號、子網掩碼關系
- 2022-06-09 LVGL?PC模擬器安裝步驟詳解_安裝教程
- 2023-07-16 spring boot 實現token攔截
- 2022-09-22 linux進程概念
- 2023-03-16 python內置函數anext的具體使用_python
- 2022-10-30 Python接口傳輸url與flask數據詳解_python
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支