Search code examples
javascriptcomponentsbrowserifyvue.js

Vue JS 0.12 Dynamic Components


I upgraded to Vue 0.12 but it's left me with a tricky problem.

I'm using Browserify/Vueify to transpile and concatenate single file component definitions. In my app component I "require" the needed components and assign to keys in the components object then use v-component="x" in the template to mount them.

Now 0.12 only allows that behaviour on table elements,how could I work around it?


Solution

  • You need to use component name as a tag name like so:

    <component-name></component-name>

    Alternatively you could do: <component is="component-name"></component>