0

I am iterating over a list (I'm using Vue.js 2 and Vuetify) and I want to have multiple <v-sheet> that have different colors. I've tried:

<v-sheet v-for="color in schema.colors" :key="color" class="float-left"
  color="`${color}`"
  elevation="1"
  height="40"
  width="40"
></v-sheet>

but that doesn't set color to the appropriate value.

I've also tried color="{{ color }}", without success. The color variable is set to a valid value, i.e. #1234ab.

1 Answer 1

1

If you want to assign variables then you need to use the bind syntax (see the colon before color)

<v-sheet v-for="color in schema.colors" :key="color" class="float-left"
  :color="color"
  elevation="1"
  height="40"
  width="40"
></v-sheet>
Sign up to request clarification or add additional context in comments.

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.