Is there any way of making this work?
Javascript:
const vm = new Vue({
el: "#app",
data: {
invoice: {
title: "test"
}
}
})
Pug:
#app
// This works
h2 {{ invoice.title }}
input(v-model="invoice.title")
// This is the thing I want to work
div(v-model="invoice")
span {{ title }}
The thing I want to achieve is to say that "this whole container is bound to this object in the data. Every child of it should try to find the wanted data in that object and not in the root.
Let's say I have a lot of properties in the homeAddress object, then I don't want to have to write
.container
span {{ homeAddress.municipality }}
span {{ homeAddress.streetNumber }}
but only
.container(v-model="homeAddress")
span {{ municipality }}
span {{ streetNumber }}
Edit: I know I can do this by declaring a component for the container, but it feels overkill.