Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Created September 14, 2019 15:58
Show Gist options
  • Save IgorDePaula/33bf16a159b697dbfd5a09f3ed9b6f34 to your computer and use it in GitHub Desktop.
Save IgorDePaula/33bf16a159b697dbfd5a09f3ed9b6f34 to your computer and use it in GitHub Desktop.
<template>
<q-page class="flex flex-center">
<component :key="index" v-for="(comps, index) in comp"
v-model="schema[comps.name]" :is="comps.is"
v-bind="comps"/>
</q-page>
</template>
<style>
</style>
<script>
export default {
name: 'PageIndex',
data () {
return {
comp: [],
schema: {}
}
},
mounted () {
fetch('http://localhost:8000/api/resource').then(res => res.json()).then(res => {
this.comp = res.schema
this.comp.forEach(function (item, i) {
this.schema[item.name] = ''
})
})
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment