tianyun 3 månader sedan
förälder
incheckning
ff62b44f94
1 ändrade filer med 43 tillägg och 14 borttagningar
  1. 43 14
      simple-demo/nav.html

+ 43 - 14
simple-demo/nav.html

@@ -270,7 +270,6 @@
                                         <i class="el-icon-plus"></i>
                                     </el-button>
                                 </div>
-
                             </div>
                         </div>
                         <div class="item-content">
@@ -387,8 +386,8 @@
                         mainUrl: "https://github.com",
                         description: "代码托管平台",
                         extraUrls: [
-                            "",
-                            "https://pages.github.com"
+                            "https://pages.github.com",
+                            "https://pages1.github.com"
                         ],
                         screenshot: ""
                     }]
@@ -551,12 +550,27 @@
 
             // 删除标签页
             deleteTab(name) {
-                const idx = this.groups.findIndex(g => g.name === name);
-                if (idx > -1) {
-                    this.groups.splice(idx, 1);
-                    this.activeTab = this.groups[0]?.name;
-                    this.updateData();
-                }
+                this.$confirm('此操作将永久删除该标签页, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const idx = this.groups.findIndex(g => g.name === name);
+                    if (idx > -1) {
+                        this.groups.splice(idx, 1);
+                        this.activeTab = this.groups[0]?.name;
+                        this.updateData();
+                    }
+                    this.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });          
+                });
             },
 // 修改标签名
             editCurrentTabName(oldName) {
@@ -584,11 +598,26 @@
 
             // 删除内容项
             deleteContentItem(groupName, index) {
-                const group = this.getGroupByName(groupName);
-                if (group) {
-                    group.datas.splice(index, 1);
-                    this.updateData();
-                }
+                this.$confirm('此操作将永久删除该内容项, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const group = this.getGroupByName(groupName);
+                    if (group) {
+                        group.datas.splice(index, 1);
+                        this.updateData();
+                    }
+                    this.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });          
+                });
             },