Your Name il y a 2 ans
Parent
révision
3ee651e2f9
3 fichiers modifiés avec 26 ajouts et 14 suppressions
  1. 23
    14
      src/components/Image.vue
  2. 2
    0
      src/components/QrCode.vue
  3. 1
    0
      src/pages/makeSaving/index.vue

+ 23
- 14
src/components/Image.vue Voir le fichier

@@ -1,15 +1,17 @@
1 1
 <template>
2
-  <img class="page-image" :src="src" alt="" @load="onLoad">
3
-  <template v-if="actions">
4
-    <CoverBtn
5
-      v-for="(action, inx) in actions"
6
-      :key="inx"
7
-      :center="centers[inx]"
8
-      :width="action.width"
9
-      :height="action.height"
10
-      @click="action.onClick"
11
-    />
12
-  </template>
2
+  <div class="img-wrapper">
3
+    <img class="page-image" :src="src" alt="" @load="onLoad">
4
+    <template v-if="actions">
5
+      <CoverBtn
6
+        v-for="(action, inx) in actions"
7
+        :key="inx"
8
+        :center="centers[inx]"
9
+        :width="action.width"
10
+        :height="action.height"
11
+        @click="action.onClick"
12
+      />
13
+    </template>
14
+  </div>
13 15
 </template>
14 16
 
15 17
 <script setup>
@@ -41,8 +43,15 @@
41 43
 </script>
42 44
 
43 45
 <style lang="less" scoped>
44
-.page-image {
45
-  display: block;
46
-  width: 100%;
46
+
47
+.img-wrapper {
48
+  position: relative;
49
+
50
+  .page-image {
51
+    display: block;
52
+    width: 100%;
53
+  }
54
+
47 55
 }
56
+
48 57
 </style>

+ 2
- 0
src/components/QrCode.vue Voir le fichier

@@ -25,6 +25,8 @@
25 25
   max-width: 1px;
26 26
   max-height: 1px;
27 27
   overflow: hidden;
28
+  top: -1000px;
29
+  left: -1000px;
28 30
   // z-index: 1000;
29 31
 
30 32
   .qrcode {

+ 1
- 0
src/pages/makeSaving/index.vue Voir le fichier

@@ -65,6 +65,7 @@
65 65
   };
66 66
 
67 67
   const onLoad = (e) => {
68
+    console.log('---------')
68 69
     const { width, height, naturalHeight, naturalWidth } = e.target;
69 70
     const xRate = width / naturalWidth;
70 71
     const yRate = height / naturalHeight;