0

How do I name my td class the name of the step in this example?

<td v-for="steps in item.steps" v:bind:class="item.steps.name">
 {{ item.steps.name }}
</td>

In this example, my class gets literally named items.steps.name rather than the return value. Everything else works.

2 Answers 2

1

Use v-bind:class not v:bind:class

Sign up to request clarification or add additional context in comments.

4 Comments

That's why i always use ":attribute" to bind ^^ I didn't even see that, nice done pal :)
can i use v-bind:class and v-bind:style in the same line?
Yes you can do that
alright thanks - for some reason i can't bind style? stackoverflow.com/questions/56402920/…
0

That's cause you are looping over item.steps with each iteration named steps and you use the variable you are looping over in the class-binding.

Try steps.name instead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.