Say we have two routes: edit/1
and edit/new
The root container (on mount) checks if there is a this.$route.params.id
and if so, fetches the data from the API and fills the obj
. Otherwise, the obj
in question remains empty.
This object is sent to a child component which has something like:
<template>
<input v-model="obj.name">
<input v-model=obj.email">
</template>
<script>
export default {
props: {
obj {
type: Object,
default: () => {}
}
},
}
</script>
The issue I'm having right now is that when I send an empty object nothing renders. Would this issue have anything to do with the empty object? As far as I can tell, properties can be added dynamically like this in Vue.
Should you need more information, please ask!