File input on change in vue.js(vue.js 中更改的文件输入)
问题描述
Using plain HTML/JS, it is possible to view the JavaScript File objects of selected files for an input element like so:
However, when converting it to the 'Vue' way it doesn't seem to work as intend and simply returns undefined
instead of returning an Array of File objects.
This is how it looks in my Vue template:
Where the previewFiles
function is simply the following (located in methods):
Is there an alternate/correct way of doing this? Thanks
Another solution:
这篇关于vue.js 中更改的文件输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!