mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Modals] Refactoring
This commit is contained in:
1 parent
707526fb2d
commit
e1d9e6302f
18 files changed
+292
-465
No files matched your search
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div>
|
||||
<input type="file" multiple name="file" id="fileInput" class="hidden-input" accept="*"
|
||||
@change="onChange" ref="fileUpload"
|
||||
/>
|
||||
|
||||
<v-btn class="upload-btn" @click="$refs.fileUpload.click()">
|
||||
<v-icon class="mx-1" icon="mdi-cloud-upload-outline"></v-icon>NAHRAŤ
|
||||
</v-btn>
|
||||
|
||||
<div v-if="files.length">
|
||||
<div
|
||||
v-for="file in files"
|
||||
:key="file.name"
|
||||
>
|
||||
<v-chip>
|
||||
{{ file.name }}
|
||||
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
||||
<v-icon size="small" icon="mdi-close" @click.stop="remove(files.indexOf(file))"></v-icon>
|
||||
</v-chip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emit: ['files-uploaded'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange() {
|
||||
this.files = [...this.files, ...this.$refs.fileUpload.files]
|
||||
this.$emit('files-uploaded', this.files)
|
||||
},
|
||||
|
||||
remove(index) {
|
||||
this.files.splice(index, 1)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.upload-btn
|
||||
color: #6200EE
|
||||
border-radius: 4px
|
||||
border: 1px solid #E5E5E5
|
||||
.hidden-input
|
||||
opacity: 0
|
||||
overflow: hidden
|
||||
position: absolute
|
||||
width: 1px
|
||||
height: 1px
|
||||
</style>
|
||||
Reference in new issue
Block a user