plugins/qrcode/CQRCode.vue | ●●●●● patch | view | raw | blame | history |
plugins/qrcode/CQRCode.vue
@@ -33,7 +33,9 @@ }, }, data() { return {}; return { lastContent: '', }; }, methods: { _renderQRCode(canvasDom) { @@ -58,9 +60,14 @@ const canvasBox = $(this.$refs.canvas.$el); const finderTimer = setInterval(() => { const canvasDom = canvasBox.find('canvas'); if (canvasDom.length > 0) { this._renderQRCode(canvasDom[0]); if (canvasDom.length === 0) { return; } if (this.lastContent === this.content) { return; } this._renderQRCode(canvasDom[0]); this.lastContent = this.content; }, 10); } else { // TODO: 小程序中获取canvas