因為業務需求,需要只調用拍照相機,不允許調用相冊,所以嘗試了
<!-- <input class="input-style" id="file" type="file" accept="image/*" capture="image/*" @change="photograph" />-->
這個方法。結果發現ios沒有問題,部分的安卓手機會出現
這個頁面,這是不能允許的。
然后上解決辦法:
<!-- <input class="input-style" id="file" type="file" accept="image/*" capture @change="photograph" />-->
沒錯,就是讓capture后面的值去掉就可以了。實測可以解決此問題。