0

Suppose that I have a data property in Vue.js called iconsColor, which is defined like this:

data() {
    return {
      iconsColor: "#b5ffff",
    };
  },

I want to be able to use this property where I am setting color like this:

:style="{ color: '#b5ffff' }"

I tried a couple of different ways

:style="{ color: '{{iconsColor}}' }"

and studied a few interpolation techniques like this and this, but I was not able to come to a solution. How this utilization can happen?

Farshid
  • 5,134
  • 9
  • 59
  • 87

1 Answers1

2

Based on this section the style could be bound to the data property as follows :

:style="{ color: iconsColor }"
Boussadjra Brahim
  • 82,684
  • 19
  • 144
  • 164