alexjoverm / v-runtime-template

Vue component for compiling templates on the fly using a v-html like API
MIT License
605 stars 72 forks source link

v-runtime-template with vue.esm.js? #2

Closed arjanski closed 6 years ago

arjanski commented 6 years ago

First of all, thank you for your work, fantastic idea for a plugin!

My setup uses vue.esm.js, and I'm having trouble getting v-runtime-template to work. Is this an issue?

Console throws the following error: Error in render: "TypeError: Cannot read property 'params' of undefined"

My code is as follows. After the npm installation, I import v-runtime-template in my parent component import VRuntimeTemplate from "v-runtime-template" where I call the component in the template section, just like in your example

<div>
  <v-runtime-template :template="template"></v-runtime-template>
</div>

with data properties

      name: "Mellow",
      template: `
        <p>Hello {{name}}!</p>
      `,

Is it a question of vue builds, or do I use v-runtime-template incorrectly in my code?

Btw I use Quasar UI, which handles webpack configuration and has the option of using vue.esm.js as a vue build.

Thanks a lot for any advice, would really like to use this plugin.

arjanski commented 6 years ago

This was an error on my end that had nothing to do with the plugin, sorry. Works very well! 👍

darshishah1011 commented 6 years ago

@arjanski , I am facing similar issue, curious how did you fix error at your end?

arjanski commented 6 years ago

Hhhm, I will look into it, tbh I recently checked my Gitlab how this got solved and couldn't find a post. Too bad actually. If I find something I will let you know.