mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Pretty basic copy/paste code for #3648
This commit is contained in:
@@ -19,53 +19,54 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="form-group"
|
||||
v-bind:class="{ 'has-error': hasError()}"
|
||||
>
|
||||
<div class="col-sm-12 text-sm">
|
||||
{{ title }}
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="input-group">
|
||||
<input multiple="multiple"
|
||||
autocomplete="off"
|
||||
:placeholder="title"
|
||||
:title="title"
|
||||
ref="input"
|
||||
:name="name" type="file" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
<button
|
||||
v-on:click="clearAtt"
|
||||
class="btn btn-default"
|
||||
type="button"><i class="fa fa-trash-o"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="list-unstyled" v-for="error in this.error">
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
v-bind:class="{ 'has-error': hasError()}"
|
||||
>
|
||||
<div class="col-sm-12 text-sm">
|
||||
{{ title }}
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="input-group">
|
||||
<input multiple="multiple"
|
||||
autocomplete="off"
|
||||
:placeholder="title"
|
||||
:title="title"
|
||||
ref="input"
|
||||
:name="name" type="file" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
<button
|
||||
v-on:click="clearAtt"
|
||||
class="btn btn-default"
|
||||
type="button"><i class="fa fa-trash-o"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="list-unstyled" v-for="error in this.error">
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CustomAttachments",
|
||||
props: {
|
||||
title: String,
|
||||
name: String,
|
||||
error: Array
|
||||
},
|
||||
methods: {
|
||||
clearAtt: function() {
|
||||
this.$refs.input.value = '';
|
||||
},
|
||||
hasError: function () {
|
||||
return this.error.length > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: "CustomAttachments",
|
||||
props: {
|
||||
title: String,
|
||||
name: String,
|
||||
error: Array
|
||||
},
|
||||
mounted: function () {
|
||||
window.addEventListener('paste', e => {
|
||||
this.$refs.input.files = e.clipboardData.files;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
clearAtt: function () {
|
||||
this.$refs.input.value = '';
|
||||
},
|
||||
hasError: function () {
|
||||
return this.error.length > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user