Consider this simplified example of a real-world app:
<html>
<body>
<script src="https://unpkg.com/vue"></script>
<div id="app">
<div id="subapp">
<p>
{{ message}}
</p>
</div>
<p>{{ message }}</p>
</div>
<script>
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
}
})
new Vue({
el: '#subapp',
data: {
message: '¡Hola Vue.js!'
}
})
</script>
</body>
</html>
I'd expect to see two different messages, but i get the same message twice.
If i change message to other_message in the 'subapp', Vuejs complains that it can not find other_message.
Is there a way to "embed" them together? Short of un-embedding the html part or merging the controllers, is there a way of getting the expected result? Alternatively, is there a better term for what i'm trying to accomplish? (english is hard sometimes)