4
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vue-qrcode-readerでQRコードを読み取る

Posted at

vue-qrcode-readerが簡単すぎて素晴らしかったのでメモ。

追加

yarn add vue-qrcode-reader
npm install vue-qrcode-reader

vueに登録

import Vue from 'vue'
import { QrcodeReader } from 'vue-qrcode-reader'

Vue.component('my-component', {
  components: { QrcodeReader },
)

使う

// html
<qrcode-reader @decode="onDecode"></qrcode-reader>

//scripts
methods: {
  onDecode (content) {
    this.paused = true
  }
}
4
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?