@thinkpixellab-public/px-vue 4.1.20 → 4.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,15 +7,18 @@
7
7
  -->
8
8
  <template>
9
9
  <div style="aspect-ratio: 1">
10
- <qrcode-vue
11
- v-if="content"
12
- :value="content"
13
- role="img"
14
- :size="size"
15
- :margin="padding"
16
- :aria-label="label || content"
17
- level="M"
18
- ></qrcode-vue>
10
+ <client-only>
11
+ <qrcode-vue
12
+ v-if="content"
13
+ :value="content"
14
+ role="img"
15
+ :size="size"
16
+ :margin="padding"
17
+ :aria-label="label || content"
18
+ :image-settings="imageSettingsLocal"
19
+ level="M"
20
+ ></qrcode-vue>
21
+ </client-only>
19
22
  </div>
20
23
  </template>
21
24
 
@@ -30,10 +33,17 @@ export default {
30
33
  content: { type: String, default: 'Hello' },
31
34
  label: { type: String },
32
35
  padding: { type: Number, default: 0 },
36
+ imageSettings: { type: Object, default: () => ({}) },
33
37
  },
34
38
  data() {
35
39
  return { size: 0 };
36
40
  },
41
+ computed: {
42
+ imageSettingsLocal() {
43
+ // qrcode.vue crashes if imageSettings is not an object
44
+ return this.imageSettings || {};
45
+ },
46
+ },
37
47
  mounted() {
38
48
  this.size = Math.min(this.$el.clientWidth, this.$el.clientHeight);
39
49
 
@@ -45,7 +55,7 @@ export default {
45
55
  this.resizeObserver.observe(this.$el);
46
56
  },
47
57
  beforeUnmount() {
48
- this.resizeObserver.disconnect();
58
+ this.resizeObserver?.disconnect();
49
59
  },
50
60
  };
51
61
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "4.1.20",
3
+ "version": "4.1.21",
4
4
  "description": "General purpose Vue components and helpers that can be used across projects.",
5
5
  "author": {
6
6
  "name": "Pixel Lab"