0๐
โ
You will need the value 691904 stored in some variable depending on some condition as 12 contains "12": [691904,649950,649031]. Then you can try:
computed: {
selectedIndex() {
const idx = votes.voteDict[catid].findIndex(num => num === 691904)
return idx === -1 ? 0 : idx
}
}
Then change your if statement to
<v-if="shop.poiId === votes.voteDict[catid][selectedIndex]">
Again, the number (691904) in the computed property should be a variable set according to some condition or dependent on the result of an API call.
0๐
You should use Array.includes to test for the shop.poiId
value. Also accessing "12" property of votes.voteDict
would be like votes.voteDict[catId]
where catId is the integer 12
<div v-if="votes.voteDict[catId].includes(shop.poiId)">
Source:stackexchange.com