Created
September 14, 2019 15:58
-
-
Save IgorDePaula/33bf16a159b697dbfd5a09f3ed9b6f34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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