file input event

This commit is contained in:
Novembert 2021-12-09 18:07:25 +01:00
parent ec7b8f4cf0
commit 03aee6d36e
2 changed files with 7 additions and 1 deletions

View File

@ -81,6 +81,7 @@ export default {
this.url = URL.createObjectURL(file)
this.name = file.name
this.file = file
this.$emit('set', { file: this.file, url: this.url })
} catch (e) {
this.url = null
this.name = null

View File

@ -2,12 +2,17 @@
<div>
<Button text="Hello World" :icon="['fas', 'undo']" @click.native="submitPhoto" />
<Button text="Without Icon" />
<InputFile label="Twój obrazek" />
<InputFile label="Twój obrazek" @set="(value) => photo = value" />
</div>
</template>
<script>
export default {
data () {
return {
photo: null
}
},
methods: {
submitPhoto () {
console.log('test')