Skip to content

Instantly share code, notes, and snippets.

@birchb
Created August 1, 2019 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birchb/f5ebe8ea4e7d9535fd830e2ffbc7d419 to your computer and use it in GitHub Desktop.
Save birchb/f5ebe8ea4e7d9535fd830e2ffbc7d419 to your computer and use it in GitHub Desktop.
<template>
...
<my-uploader
flat
color="grey-3"
text-color="grey-10"
style="min-width: 418px"
@uploaded="videoUploaded"
@failed="videoUploadFailed"
:pathPrefix="`${currentUser.uid}/videos`"
square
>
<template v-slot:header="scope">
<div class="row no-wrap items-center q-pa-sm q-gutter-xs">
<q-btn
v-if="scope.queuedFiles.length > 0"
icon="clear_all"
@click="scope.removeQueuedFiles"
round
dense
flat
>
<q-tooltip>Clear All</q-tooltip>
</q-btn>
<q-btn
v-if="scope.uploadedFiles.length > 0"
icon="done_all"
@click="scope.removeUploadedFiles"
round
dense
flat
>
<q-tooltip>Remove Uploaded Files</q-tooltip>
</q-btn>
<q-spinner
v-if="scope.isUploading"
class="q-uploader__spinner"
/>
<div class="col">
<div class="q-uploader__title">Upload your video</div>
<div class="q-uploader__subtitle">
{{ scope.uploadSizeLabel }} /
{{ scope.uploadProgressLabel }}
</div>
</div>
<q-btn v-if="scope.canAddFiles" type="a" icon="add_box" round dense flat>
<q-uploader-add-trigger/>
<q-tooltip>Pick Files</q-tooltip>
</q-btn>
<q-btn
v-if="scope.editable && scope.queuedFiles.length > 0"
icon="cloud_upload"
@click="scope.upload"
round
dense
flat
>
<q-tooltip>Upload Files</q-tooltip>
</q-btn>
<q-btn
v-if="scope.editable && scope.isUploading"
icon="clear"
@click="scope.abort"
round
dense
flat
>
<q-tooltip>Abort Upload</q-tooltip>
</q-btn>
<q-btn
v-if="!scope.isUploading"
icon="mdi-close"
@click="toggleUploadVideoDialog()"
flat
round
dense
/>
</div>
</template>
</my-uploader>
...
<template>
<script>
import myUploader from 'src/myUploader.js'
<script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment