Quellcode durchsuchen

更新 Swiper组件默认数据引用

wzh vor 4 Jahren
Ursprung
Commit
423c7a1a5b
1 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. 9 6
      src/components/Swiper.vue

+ 9 - 6
src/components/Swiper.vue

@@ -16,13 +16,17 @@ import { mapState } from "vuex";
 import exchangeUrl from "utils/exchangeUrl";
 
 export default {
+  props: {
+    imgs: {
+      type: Array,
+      default: [
+        // "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/data-platform/ship2.jpg",
+        // "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/data-platform/ship1.jpg",
+      ],
+    },
+  },
   setup() {
     let swiper = ref({});
-    let imgs = ref([
-      "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/data-platform/ship2.jpg",
-      "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/data-platform/ship1.jpg",
-    ]);
-
     function init() {
       swiper.value = new Swiper(".mySwiper", {
         navigation: {
@@ -38,7 +42,6 @@ export default {
     return {
       init,
       exchangeUrl,
-      imgs,
     };
   },
 };