简体   繁体   中英

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?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM