Skip to content

Commit cc9e707

Browse files
committed
not possible to trigger the q-uploader __pick method quasarframework#1311
1 parent dd2134f commit cc9e707

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

dev/components/components/uploader.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
@remove:cancel="removeCancel"
2828
/>
2929

30+
<q-btn color="primary" @click="pick" style="margin-top: 15px">Pick Files</q-btn>
3031
<q-btn color="primary" @click="reset" style="margin-top: 15px">Reset the above Uploader</q-btn>
3132

3233
<p class="caption">Single File Upload - No Upload Button</p>
@@ -94,6 +95,9 @@ export default {
9495
}
9596
},
9697
methods: {
98+
pick () {
99+
this.$refs.upld.pick()
100+
},
97101
clear () {
98102
this.events = []
99103
},

src/components/uploader/QUploader.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ export default {
414414
})
415415
})
416416
},
417+
pick () {
418+
if (!this.addDisabled) {
419+
this.$refs.file.click()
420+
}
421+
},
417422
upload () {
418423
const length = this.queueLength
419424
if (this.disable || length === 0) {

0 commit comments

Comments
 (0)