file input event
This commit is contained in:
parent
ec7b8f4cf0
commit
03aee6d36e
@ -81,6 +81,7 @@ export default {
|
|||||||
this.url = URL.createObjectURL(file)
|
this.url = URL.createObjectURL(file)
|
||||||
this.name = file.name
|
this.name = file.name
|
||||||
this.file = file
|
this.file = file
|
||||||
|
this.$emit('set', { file: this.file, url: this.url })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.url = null
|
this.url = null
|
||||||
this.name = null
|
this.name = null
|
||||||
|
@ -2,12 +2,17 @@
|
|||||||
<div>
|
<div>
|
||||||
<Button text="Hello World" :icon="['fas', 'undo']" @click.native="submitPhoto" />
|
<Button text="Hello World" :icon="['fas', 'undo']" @click.native="submitPhoto" />
|
||||||
<Button text="Without Icon" />
|
<Button text="Without Icon" />
|
||||||
<InputFile label="Twój obrazek" />
|
<InputFile label="Twój obrazek" @set="(value) => photo = value" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
photo: null
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submitPhoto () {
|
submitPhoto () {
|
||||||
console.log('test')
|
console.log('test')
|
||||||
|
Loading…
Reference in New Issue
Block a user