美好的一天。
我们正在使用https://github.com/vuejs/vue-hackernews-2.0使用Vuejs / Vuex / vue-router构建应用程序
当使用IE11构建和查看我们的应用程序时,我们得到一个SCRIPT1046: Multiple definitions of a property not allowed in strict mode,它引用编译后的app.[#hash].js文件。我已经在组件中将重复属性跟踪到以下内容:
<div class="form-group form-group-list">
<label aria-labelledby="Shopping preference">Shopping preference</label>
<ul class="inline">
<li>
<label for="users__secondary_signup__gender__female" aria-labelledby="Gender female">
<span class="enhanced-radio" :class="{ 'selected': selectedGender === 'FEMALE' }">
<input id="users__secondary_signup__gender__female" class="enhance-radio"
:checked="selectedGender === 'FEMALE'" name="gender"
type="radio" value="FEMALE" v-model="selectedGender">
</span> Female
</label>
</li>
<li>
<label for="users__secondary_signup__gender__male" aria-labelledby="Gender male">
<span class="enhanced-radio" :class="{ 'selected': selectedGender === 'MALE' }">
<input id="users__secondary_signup__gender__male" class="enhance-radio"
:checked="selectedGender === 'MALE'" name="gender"
type="radio" …Run Code Online (Sandbox Code Playgroud) 我在使用Cordova制作的应用程序上使用此条形码扫描程序(https://github.com/wildabeast/BarcodeScanner),专门用于在Android设备上使用.
我在JavaScript中设置了以下功能:
$(document).ready(function(){
$('#scanner').click( function(){
console.log('clicked'); //to see if the function is firing
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
}
);
});
});
Run Code Online (Sandbox Code Playgroud)
正如为此插件提供的文档中所述.我已使用cordova CLI将其添加到我的项目中:
$ cordova add plugin https://github.com/wildabeast/BarcodeScanner.git
Run Code Online (Sandbox Code Playgroud)
当我列出项目的可用插件时,我可以看到它已正确安装.此外,我可以在我的应用程序中使用相机按钮启动正确的功能,并可以使用后置摄像头扫描没有问题.
有没有办法使用前置摄像头进行扫描?如果它不在插件中,是否有任何方法可以设置设备使用的默认摄像头,在代码中默认使用前置摄像头?我们正在开发的应用程序只需要专门使用前置摄像头,而不需要背面摄像头.
任何帮助将不胜感激.