mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Extract QRCode controller
This commit is contained in:
parent
e5042074a2
commit
3125eb43ad
4 changed files with 12 additions and 11 deletions
10
assets/controllers/qrcode_controller.js
Normal file
10
assets/controllers/qrcode_controller.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
import jrQrcode from 'jr-qrcode';
|
||||
|
||||
export default class extends Controller {
|
||||
static values = { url: String };
|
||||
|
||||
connect() {
|
||||
this.element.setAttribute('src', jrQrcode.getQrBase64(this.urlValue));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue