forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestrictionBasic.vue
More file actions
62 lines (55 loc) · 1.4 KB
/
RestrictionBasic.vue
File metadata and controls
62 lines (55 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
<div class="q-pa-md">
<div class="q-gutter-md row items-start">
<q-uploader
style="max-width: 300px"
url="http://localhost:4444/upload"
label="Restricted to images"
multiple
accept=".jpg, image/*"
@rejected="onRejected"
/>
<q-uploader
style="max-width: 300px"
url="http://localhost:4444/upload"
label="Max file size (2k)"
multiple
max-file-size="2048"
@rejected="onRejected"
/>
<q-uploader
style="max-width: 300px"
url="http://localhost:4444/upload"
label="Max total upload size (4k)"
multiple
max-total-size="4096"
@rejected="onRejected"
/>
<q-uploader
style="max-width: 300px"
url="http://localhost:4444/upload"
label="Max number of files (3)"
multiple
max-files="3"
@rejected="onRejected"
/>
</div>
</div>
</template>
<script>
import { useQuasar } from 'quasar'
export default {
setup () {
const $q = useQuasar()
function onRejected (rejectedEntries) {
// Notify plugin needs to be installed
// https://quasar.dev/quasar-plugins/notify#Installation
$q.notify({
type: 'negative',
message: `${rejectedEntries.length} file(s) did not pass validation constraints`
})
}
return { onRejected }
}
}
</script>