首页 > 解决方案 > 带有摄像头捕获的 Vue v-file-input

问题描述

vue中有没有办法从相机获取文件输入,类似于普通的html方法:

<input type="file" accept="image/*" capture="camera" />

我正在寻找这样的东西:

<v-file-input capture="camera" />

标签: htmlvue.jsvuejs2vue-componentvuetify.js

解决方案


基于w3 文档,您应该使用capturewithuser作为值并添加accept属性:

 <v-file-input
      label="File input"
      outlined
      dense
      capture="user"
      accept="image/*"
    ></v-file-input>

推荐阅读