首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >离子vue框架(电容器),QRCode扫描器问题

离子vue框架(电容器),QRCode扫描器问题
EN

Stack Overflow用户
提问于 2021-05-31 08:32:50
回答 2查看 1.2K关注 0票数 1

在我的离子vue.js项目中,我使用电容,我想从相机中阅读QR代码,但是我没有办法在搜索中找到任何关于离子vue.js的东西。我尝试的比我发现的更多,'https://www.npmjs.com/package/vue3-qrcode-reader'.有了这个小小的东西,我可以从网络和安卓手机上读取QR代码,但是iOS设备不能使用它。我试着用电容条形码扫描器。如果我尝试使用电容-条形码扫描器,Xcode会给我错误,比如“您需要升级开发目标版本”并升级到。请告诉我,没有办法建立QR代码扫描仪应用程序的离子- VUE与电容器?

以下是我在vue3-qrcode-reader中的错误

这是我使用的代码

代码语言:javascript
复制
<template>
  <ion-page>
    <ion-header class="ion-no-border" >
      <ion-toolbar style="--background: var(--primary)">
        <ion-buttons slot="start">
          <ion-back-button text=""></ion-back-button>
        </ion-buttons>
        <ion-title style="color: white">Please Read Barcode</ion-title>
      </ion-toolbar>
    </ion-header>
    <ion-content>
      <qr-stream @decode="onDecode" class="mb">
        <div style="color: yellow;" class="frame"></div>
      </qr-stream>

    </ion-content>
    <div style="background-color: var(--primary); width: 100%; position: fixed; bottom: 0; padding: 20px">
      <p style="color: blue; text-align: center; color: white">Please Read Barcode On Paper</p>
    </div>
  </ion-page>
</template>

<script >

import { QrStream } from 'vue3-qr-reader';
import { Camera } from '@capacitor/camera';

import { defineComponent } from 'vue';
import {IonBackButton, IonButtons, IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from "@ionic/vue";

export default defineComponent({
  name: 'barcode-read',
  components: {
    QrStream,
    IonContent,
    IonPage,
    IonHeader,
    IonTitle,
    IonToolbar,
    IonBackButton,
    IonButtons,
  },
  created() {
    Camera.requestPermissions();
  },
  methods: {
    onDecode(data) {
      console.log("Decoder = "+data);
      this.$router.push('Welcome')
    }
  },
});

</script>
EN

回答 2

Stack Overflow用户

发布于 2021-06-10 14:08:36

解决办法可能是拍摄一张照片,然后使用像这个包https://www.npmjs.com/package/qrcode-reader这样的不同包来解析它,但是实时解决方案更好。

票数 0
EN

Stack Overflow用户

发布于 2022-03-01 08:43:02

您使用的是哪个iOS版本?超过14.2的iOS版本不允许在iOS视图中使用WebRTC。

您可以尝试像这样的电容插件:capacitor-plugin-dynamsoft-barcode-reader

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67770356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档