【发布时间】:2020-05-22 03:08:38
【问题描述】:
请看我下面的代码。我的input 运行良好,但v-file-input 不行:
<v-file-input
accept=".json"
ref="loadedFile"
label="Upload file"
@change="checkJSON"
></v-file-input>
<input
type="file"
accept=".json"
@change="checkJSON"
>
methods: {
checkJSON: function(e) {
console.log("JSON checking")
console.log(JSON.stringify(e))
console.log(e.target.files)
return
}
}
控制台显示input 的文件,但这是我收到的v-file-input 的消息:
[Vue warn]: Error in v-on handler: "TypeError: e.target is undefined"
这正常吗?我想使用 vuetify 组件,它更漂亮。 提前致谢。
【问题讨论】:
标签: vue.js vuetify.js