I am displaying an image conditionally depending on what the value is. The value is a string. However it only returns the first image. It does not go through the entire function.
- I tried placing brackets around the values and it does work but only ever checks the first string.
- Tried using one equals sign, doesn't change anything.
methods: {
resultImage(value) {
if (
value === 'Less likely' ||
'More likely light' ||
'More likely blue' ||
'More likely curly'
) {
return this.low
} else if (value === 'Average chance') {
return this.medium
} else if (
value === 'Somewhat more likely' ||
'Somewhat more likely brown' ||
'Somewhat more likely curly'
) {
return this.mediumHigh
} else if (
value === 'More likely' ||
'More likely dark' ||
'More likely brown' ||
'More likely straight'
) {
return this.high
}
}
}
Expect the function to cycle to the end and return an image based on the value. Actual results is that it returns the first image.