uqrcode.vue 526 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view class="uqrcode">
  3. <canvas id="qrcode" canvas-id="qrcode" :style="{'width': `${options.size}px`, 'height': `${options.size}px`}" />
  4. </view>
  5. </template>
  6. <script>
  7. import uqrcode from './common/uqrcode'
  8. export default {
  9. name: 'uqrcode',
  10. data() {
  11. return {
  12. options: {
  13. canvasId: 'qrcode',
  14. size: 354,
  15. margin: 10,
  16. text: ''
  17. }
  18. }
  19. },
  20. methods: {
  21. make(options) {
  22. return uqrcode.make(Object.assign(this.options, options), this)
  23. }
  24. }
  25. }
  26. </script>
  27. <style>
  28. </style>