vuejs2 - Vue 3 文件上传验证无法运行我的项目
问题描述
我的意见
<input
id="image-input"
@input="v$.checkfile.$touch()"
accept="image/png, image/gif, image/jpeg"
type="file"
@change="onFileChange(1, $event)"
/>
我的剧本
export default {
setup() {
return { v$: useVuelidate() };
},
data() {
return {
checkfile: "",
};
},
validations() {
return {
checkfile: {
checkImageFile(event){
const file = event.target.files;
if(file){
alert(file)
}else{
alert("Not file chosen ")
}
}
},
};
},
我的 vue 3 项目使用 vuelidate 但我的项目文件上传 vuelidate 不起作用我不明白是什么问题请帮助我谢谢。
解决方案
推荐阅读
- php - MySql 通过 Ultimate Member Plugin 查询散列密码?
- laravel - 如何在 laravel 上限制特定用户的路由
- c# - 在使用 ASP.NET Core 3.0 首次加载之前,通过授权服务器保护 SPA 的正确方法是什么?
- python - 如果用户说“不”,则“返回”if 语句
- matlab - matlab中用于灰度的imfinfo函数
- python - Python 对象矩阵 - 定义属性
- python - 如何在不指定固定解码器长度的情况下创建 seq2seq?
- powershell - 跨网络 csv 的 Bitlocker 发现扫描不返回数据 Powershell
- enums - 使用可重用枚举时创建文档的问题
- vba - 无法制作复杂的类