Utilizing Vue.js for data binding and filtering has been a rewarding experience. I've set up a Vue object within a .js file and now I aim to pass external data into it.
Let's take a look at my test object testFile.js:
var vm = new Vue({
el: "#results",
data: {
results: [],
},
});
Here is what I try to do in my html:
<script>
window.onload = function () {
vm.results = [
{ name: 'Bron Smith', aliases: [], age: '', state: 'FL', locations: ['Miami','Orlando','Biscayne'], relatives: ['Dana Smith', 'Diana Smith', 'Test Smith'], report: 'dsgsd'},
];
};
</script>
Although my Vue object receives the data, it doesn't display on the html page. Any suggestions on how I can successfully pass and showcase this data in the html?