free-fe-core-modules 0.0.49 → 0.0.51

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.
@@ -108,7 +108,9 @@
108
108
  flat
109
109
  class="file-list-item"
110
110
  v-for="(file, index) in fieldData.value" :key="index">
111
- <e-icon class="file-image" :name="fileThumb(file)" thumb
111
+ <e-icon class="file-image"
112
+ :name="fileThumb(file)"
113
+ :thumb="!Field?.Options?.NoThumb"
112
114
  :relative="filePreviewType(file) !== 'image'"
113
115
  @click="preview(file)">
114
116
  <div class="view-btn-wrapper absolute-full justify-center text-center">
@@ -1,3 +1,6 @@
1
+ import { h, getCurrentInstance, } from 'vue';
2
+ import { useQuasar } from 'quasar';
3
+
1
4
  import { useModelToggleProps, useModelToggleEmits } from 'quasar/src/composables/private.use-model-toggle/use-model-toggle.js';
2
5
 
3
6
  export default {
@@ -39,6 +42,32 @@ export default {
39
42
  this.height = event.data;
40
43
  });
41
44
  },
45
+ setup(props) {
46
+ const { proxy:vm } = getCurrentInstance();
47
+ const $q = useQuasar();
48
+
49
+ return () => {
50
+ if (props.src !== undefined && props.src.length > 0) {
51
+ return h(
52
+ 'div',
53
+ {
54
+ staticClass: 'q-pdfviewer',
55
+ class: props.contentClass,
56
+ style: props.contentStyle,
57
+ },
58
+ [
59
+ ($q.platform.is.electron || props.type === 'pdfjs')
60
+ // eslint-disable-next-line no-underscore-dangle
61
+ ? vm.__renderIFramePDFJS(h)
62
+ // eslint-disable-next-line no-underscore-dangle
63
+ : vm.__renderObject(h),
64
+ ],
65
+ );
66
+ }
67
+
68
+ return ''
69
+ };
70
+ },
42
71
  methods: {
43
72
  // eslint-disable-next-line no-underscore-dangle
44
73
  __renderObject(h) {
@@ -72,11 +101,9 @@ export default {
72
101
  'iframe',
73
102
  {
74
103
  staticClass: 'q-pdfviewer__iframe',
75
- attrs: {
76
- src: this.src,
77
- width: '100%',
78
- height: '100%',
79
- },
104
+ src: this.src,
105
+ width: '100%',
106
+ height: '100%',
80
107
  },
81
108
  );
82
109
  },
@@ -87,36 +114,11 @@ export default {
87
114
  'iframe',
88
115
  {
89
116
  staticClass: 'q-pdfviewer__iframe',
90
- attrs: {
91
- src: `pdfjs${this.version ? `_${this.version}` : ''}/web/viewer.html?file=${encodeURIComponent(this.src)}`,
92
- width: '100%',
93
- height: '100%',
94
- },
117
+ src: `pdfjs${this.version ? `_${this.version}` : ''}/web/viewer.html?file=${encodeURIComponent(this.src)}`,
118
+ width: '100%',
119
+ height: '100%',
95
120
  },
96
121
  );
97
122
  },
98
123
  },
99
-
100
- render(h) {
101
- if (this.value === true && this.src !== undefined && this.src.length > 0) {
102
- return h(
103
- 'div',
104
- {
105
- staticClass: 'q-pdfviewer',
106
- class: this.contentClass,
107
- style: this.contentStyle,
108
- attrs: {
109
- },
110
- },
111
- [
112
- this.$q.platform.is.electron || this.type === 'pdfjs'
113
- // eslint-disable-next-line no-underscore-dangle
114
- ? this.__renderIFramePDFJS(h)
115
- // eslint-disable-next-line no-underscore-dangle
116
- : this.__renderObject(h),
117
- ],
118
- );
119
- }
120
- return '';
121
- },
122
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",