I have an array. Inside that array I need to display the random component. In my case it's FeedbackComponent. It should be displayed before the last two objects in array. So it should be something like this schematically:
storyObject storyObject storyObject storyObject storyObject feedbackComponent storyObject storyObject
What is the way to show that component inside the list without mutating the array ? I've been looking for something that is available in React like rendering inside component.
So here's my PortfolioComponent.vue that consists of the few objects (that is stored in json data)
<template>
<ul class="portfolio">
<story-component
v-for="story in portfolio"
:key="story.id"
:story-name="story.name"
:story-title="story.title" />
<li is="feedback-component" class="portfolio__feedback"></li>
</ul>
</template>
<script>
import portfolio from '@assets/data/portfolio.json';
import StoryComponent from './StoryComponent';
import FeedbackComponent from './FeedbackComponent';
export default {
components: {
StoryComponent,
FeedbackComponent,
},
data() {
return {
portfolio,
};
},
};
</script>
Here's html of my StoryComponent.vue
<template>
<li class="story">
<span class="story__name">{{ storyName }}</span>
<span class="story__title">{{ storyTitle }}</span>
</li>
</template>
Hope that's enough and I've explained that clear.