I'm currently working on two different sections of the website
First: Is it acceptable to use one instance within another, particularly with v-model
? Are there any drawbacks to this approach?
Second: Is there a way to reference each other, such as placing the footer
in the aside
section even if one is declared before the other? When I attempt to do this, I receive an error stating "footer is undefined".
Here is my JavaScript code:
var aside = new Vue({
"el": "aside",
data: {
name: "Peylan"
}
});
var footer = new Vue({
"el": "footer",
data: {
companyname: "Company Inc"
}
});
This is my HTML code:
<aside><h3 v-bind="footer.companyname"></h3></aside>
<footer>
<input type="text" v-model="aside.name">
</footer>