-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stages from array of objects instead of strings #24
Comments
@jfdelarosa have you find a solution for this ? |
Couldn't you just create a computed property for getting the array of objects in the correct shape? stageNames () {
return this.stages.map(stage => stage.name)
} |
It’s will work , but in my case I needed the Object to get more data like the icon and the color of each stage from the DB
I wish if there is a simpler way than the computed property . |
Sure but then you can pass the array of Something like this should work? <Kanban :stages="stageNames" :blocks="blocks">
<div v-for="stage in stages" :slot="stage.name" :key="stage.name" :style="{ color: stage.color }">
<h2>
<i class="fas" :class="'fa-'+stage.icon"></i>
{{ stage.name }}
</h2>
</div>
</Kanban> |
Unfortunately, I leaved the project in wich I used this component. @BrockReece that is the most logical solution, unfortunately it didn't work, I can't remember why :/ |
@jfdelarosa I tried my suggestion above and it seemed to work. I can't think of a way of refactoring this without making breaking changes or adding a tonne of |
Is it possible to render the board with the stages made of an array of objects instead of an array of strings?
I mean, something like this:
Instead of:
stages: ["Stage 1", "Stage 2", "Stage 3"]
My structure is the following:
This is the result:

https://screencast.com/t/NTcrSUWqe
Thanks!
The text was updated successfully, but these errors were encountered: