@adminforth/upload 1.0.23 → 1.0.24
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.
- package/ChangeLog.md +7 -0
- package/custom/uploader.vue +8 -1
- package/dist/custom/uploader.vue +8 -1
- package/package.json +1 -1
package/ChangeLog.md
ADDED
package/custom/uploader.vue
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
61
|
</div>
|
|
62
|
-
<input :id="inputId" type="file" class="hidden" @change="onFileChange" ref="uploadInputRef" />
|
|
62
|
+
<input :id="inputId" type="file" :accept="allowedExtensionsAttribute" class="hidden" @change="onFileChange" ref="uploadInputRef" />
|
|
63
63
|
</label>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
@@ -134,6 +134,13 @@ const allowedExtensionsLabel = computed(() => {
|
|
|
134
134
|
return label
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
const allowedExtensionsAttribute = computed(() => {
|
|
138
|
+
const allowedExtensions = props.meta.allowedExtensions || [];
|
|
139
|
+
return allowedExtensions.length > 0
|
|
140
|
+
? allowedExtensions.map(ext => `.${ext}`).join(', ')
|
|
141
|
+
: '';
|
|
142
|
+
});
|
|
143
|
+
|
|
137
144
|
function clear() {
|
|
138
145
|
imgPreview.value = null;
|
|
139
146
|
progress.value = 0;
|
package/dist/custom/uploader.vue
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
61
|
</div>
|
|
62
|
-
<input :id="inputId" type="file" class="hidden" @change="onFileChange" ref="uploadInputRef" />
|
|
62
|
+
<input :id="inputId" type="file" :accept="allowedExtensionsAttribute" class="hidden" @change="onFileChange" ref="uploadInputRef" />
|
|
63
63
|
</label>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
@@ -134,6 +134,13 @@ const allowedExtensionsLabel = computed(() => {
|
|
|
134
134
|
return label
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
const allowedExtensionsAttribute = computed(() => {
|
|
138
|
+
const allowedExtensions = props.meta.allowedExtensions || [];
|
|
139
|
+
return allowedExtensions.length > 0
|
|
140
|
+
? allowedExtensions.map(ext => `.${ext}`).join(', ')
|
|
141
|
+
: '';
|
|
142
|
+
});
|
|
143
|
+
|
|
137
144
|
function clear() {
|
|
138
145
|
imgPreview.value = null;
|
|
139
146
|
progress.value = 0;
|