I'm trying to convert a legacy app from Vue 2 to Vue 3. I'm not super familiar with Vue, I'm trying to follow the new migration template they provide on their docs website but I'm running into issues. I'm not getting any JS console errors, but my Vue code is no longer rendering anymore.
Existing Code
<script>
var vm = new Vue({
el: "#app",
data: {
applications: []
},
created: function () {
console.log('Vue App Created');
this.loadModel();
},
methods:
{
loadModel: function () {
var url = "/Home/ApplicationData";
$.get(url, function (resp) {
console.log(resp); // Note: For Testing
vm.applications = resp;
});
}
}
});
</script>
My Attempt at Vue 3 Migration
<script>
Vue.createApp({
data() {
return {
applications: []
}
},
created() {
console.log('Vue App Created');
this.loadModel();
},
methods: {
loadModel: function () {
var url = "/Home/ApplicationData";
$.get(url, function (resp) {
console.log(resp); // Note: For Testing
vm.applications = resp;
});
}
}
}).mount('#app')
</script>
HTML
<div id="app">
<ul>
<li v-for="application in applications">{{ application.name }} - {{ application.url }}</li>
</ul>
</div>