Quiz Entry - updated: 2026.06.20
How do you create and mount a Vue.js application?
You pass a config object with a data() function to Vue.createApp(), then attach it to the page with .mount() and a CSS selector.
<div id="msg">
<p>{{ message }}</p>
</div>
<script>
Vue.createApp({
data() {
return {
message: "Hello World"
}
}
}).mount('#msg');
</script>
The data() function returns an object whose properties become available in the template.