I'd like to try out vue-html-to-paper and I did the simplest setup according to the documentation. I am using Vue3 though.
npm install vue-html-to-paper
//main.js
[...]
import VueHtmlToPaper from "vue-html-to-paper";
createApp(App)
.use(VueHtmlToPaper)
.mount("#app");
And my component:
<template>
<div>
<div id="example">
Hello World
</div>
<button @click="print">
Print
</button>
</div>
</template>
<script>
export default {
name: "my_component",
methods: {
print: function() {
this.$htmlToPaper("example");
},
},
</script>
[...]
On dev I get an error in console [...] Cannot set property '$htmlToPaper' of undefined [...]
. What am I doing wrong?
Thanks, I'd appreciate a hint.