mycurelabs / vue-html2canvas

Vue mixin for Html2Canvas
MIT License
116 stars 23 forks source link

Syntax Error: SyntaxError: .../src/views/Page.vue: await is a reserved word #2

Closed zacsneds closed 6 years ago

zacsneds commented 6 years ago

Hey mate.

I am having trouble getting past the error on this line from your example. 'this.output = await this.$html2canvas(el, options)'

The error is Syntax Error: SyntaxError: .../src/views/Page.vue: await is a reserved word

Any ideas on how I can fix this?

Thanks in advance! Zac

jofftiquez commented 6 years ago

Hey Zac, thanks for using this plugin.

this.$html2canvas() is a promise so if you're not using async await you could do this:

this.$html2canvas(el, options)
    .then(output => {
        // output here
    })
    .catch(error => console.error(error))

Let me know it this works.

Cheers!

jofftiquez commented 6 years ago

Closing this for now.