scopewu / qrcode.vue

A Vue.js component to generate qrcode. Supports both Vue 2 and Vue 3. 一款同时支援 Vue 2 和 Vue 3 的二维码组件。
https://qr-vue.tie.pub
MIT License
711 stars 87 forks source link

renderAs prop not working after deployment #38

Closed casabian closed 3 years ago

casabian commented 3 years ago

As mentioned in #17 renderAs prop is not working after deployment. I'm currently using Version 1.7.0 as i'm running vue 2.x

scopewu commented 3 years ago

Hi @casabian, Have tried using the render-as="svg"? In my browser, it is working ok with vue@2.6.14 and qrcode.vue@1.7.0.

<script src='https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/qrcode.vue@1.7.0/dist/qrcode.vue.min.js'></script>
<div id='root'></div>
<script>
  new Vue({
    el: '#root',
    template: '<qrcode-vue value="123" render-as="svg" :size="200"></qrcode-vue>',
    components: { QrcodeVue }
  })
</script>

If it still doesn't work, please tell me your browser and vue version.

casabian commented 3 years ago

Hi @scopewu thanks for your quick reply! I was the render-as parameter as follows: <qrcode-vue :value="componentText" class="resizable-image" renderAs="svg" /> changing from renderAs to render-as solved the problem for me. You should consider updating your docs.