Explorar el Código

主页布局增加删除确认

louhangfei hace 2 años
padre
commit
e39ff49d89
Se han modificado 1 ficheros con 11 adiciones y 7 borrados
  1. 11 7
      src/views/page-config/component/PageMain.vue

+ 11 - 7
src/views/page-config/component/PageMain.vue

@@ -31,13 +31,16 @@
           <el-checkbox @change="toSend(item.id, $event)" />
           <img src="~@/assets/icons/file.png" alt="" style="margin-left: 5px" />
           <div class="pic-name">{{ item.name }}</div>
-          <img
-            v-show="item.id === IconId"
-            src="~@/assets/icons/del.png"
-            alt=""
-            style="margin-left: 20px"
-            @click.stop="deleteItem(item)"
-          />
+          <el-popconfirm title="确认要删除吗?" @confirm="deleteItem(item)" :teleported="false">
+            <template #reference>
+              <img
+                v-show="item.id === IconId"
+                src="~@/assets/icons/del.png"
+                alt=""
+                style="margin-left: 20px"
+              />
+            </template>
+          </el-popconfirm>
         </div>
       </div> </div
   ></div>
@@ -48,6 +51,7 @@
   import { Plus } from '@element-plus/icons-vue';
   import { getCompanyLayoutList, delCompanyLayout } from '@/api/scene/scene';
   import MapContainerSmall from './mapContainer/MapContainerSmall.vue';
+  import { template } from 'lodash-es';
 
   interface companyLayoutType {
     createdAt: string;