Jeroen
Jeroen

Reputation: 169

v-for dynamic component vuejs 1.0

Is it possible to dynamic load vue components with v-for?

  data: {
    "components" : [
      {"type": "my-first"},
      {"type": "my-second"}
    ]
  }

<component v-for="com in components" is="com.type"></component>

Full example

I have seen an example with v-repeat but this is deprecated in Vue 1.0. link

Upvotes: 1

Views: 457

Answers (1)

Jeroen
Jeroen

Reputation: 169

It needed the right data binding :is="com.type"

link

Upvotes: 1

Related Questions