[fix] Repair files indicator

This commit is contained in:
ljf 2021-08-27 01:10:14 +02:00
parent 927886334b
commit 985f55fd6b

View file

@ -9,7 +9,7 @@
:id="id" :id="id"
:required="required" :required="required"
v-on="$listeners" v-on="$listeners"
:placeholder="placeholder" :placeholder="placeholder_"
:accept="accept" :accept="accept"
@blur="$parent.$emit('touch', name)" @blur="$parent.$emit('touch', name)"
/> />
@ -22,7 +22,8 @@ export default {
data () { data () {
return { return {
file: null file: this.value,
placeholder_: (this.value) ? this.value.name : this.placeholder
} }
}, },
@ -38,6 +39,8 @@ export default {
methods: { methods: {
clearFiles () { clearFiles () {
this.file = null
this.placeholder_ = this.placeholder
this.$refs['file-input'].reset() this.$refs['file-input'].reset()
} }
} }