lrf преди 7 месеца
родител
ревизия
c2ca81992a
променени са 1 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 12 1
      src/views/system/design/index.vue

+ 12 - 1
src/views/system/design/index.vue

@@ -28,8 +28,12 @@
                     <el-input v-model="row.to" placeholder="跳转地址"></el-input>
                   </template>
                 </el-table-column>
+                <el-table-column align="center" label="操作">
+                  <template #default="{ row }">
+                    <el-button type="danger" text @click="toDeleteCarousel(row)">删除</el-button>
+                  </template>
+                </el-table-column>
               </el-table>
-
             </template>
             <!-- <template #friend>
               <el-col :span="24" class="tables">
@@ -227,6 +231,13 @@ const delFriendship = (e) => {
   let friendship = form.value.friendship.filter((i) => i.id != e.id)
   form.value.friendship = friendship
 }
+
+const toDeleteCarousel = (data) => {
+  const key = 'uri'
+  const index = form.value.carouselUrl.findIndex((f) => f[key] === data[key])
+  console.log(index)
+  if (index >= 0) form.value.carouselUrl.splice(index, 1)
+}
 </script>
 <style scoped lang="scss">
 .tables {