I am facing an issue with two JavaScript files I have. The first one contains Vue code, while the other one includes a data array where I created the 'Feed' array. However, when trying to output a simple string from that array, the console throws an error saying 'Feed is not defined'. Any suggestions on how to resolve this?
window.Feed = (function(){
const stories = [
{
id:1,
title:'Levani',
text:'lorem ipsum',
votes:0,
postedAt: '3min ago',
storyImage: 'https://loremflickr.com/320/240?random=1'
},]
return {stories: stories};
new Vue({
el: '#app',
data:{
stories: Feed.stories
},
methods:{
}
});
<img v-bind:src="stories[0].storyImage" />
<script src="https://unpkg.com/vue"></script>
<script src="data.js"></script>
<script src="main.js"></script>