Skip to content

Instantly share code, notes, and snippets.

@pespantelis
Created June 3, 2016 01:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pespantelis/8b8039a65fa2c22e93f3dcad86ae0718 to your computer and use it in GitHub Desktop.
Save pespantelis/8b8039a65fa2c22e93f3dcad86ae0718 to your computer and use it in GitHub Desktop.
QR-Code directive for Vue.js http://codepen.io/pespantelis/pen/bedGJK
// https://github.com/davidshimjs/qrcodejs/
Vue.directive('qrcode', function (data) {
Vue.nextTick(() => {
qrcodeOptions.text = typeof data === 'object'
? data.href || data.value || data.text
: data
new QRCode(this.el, qrcodeOptions)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment