How does vue return the corresponding value?

< div class= "a" data-id="0" > {{state}} < / div >
< div class= "a" data-id="1" > {{state}} < / div >
< div class= "a" data-id="2" > {{state}} < / div >
0 Shipping 1 has been shipped 2 refund

div is looped out of the background data. How to return the corresponding value to the current state.
how to say. That"s how js used to be.
var arr= ["to be shipped", "shipped", "refund"]
arr [{{state}}], what does it say in vue?

Sep.17,2021

list = [
{value: 0, label: 'shipping'},
{value: 1, label: 'shipped'},
{value: 2, label: 'refund'}
]

use v-for to traverse this list, to generate div
< div v talk for = "item of list" class= "a": data-id='item.value': key= "item.value" > {{item.label}} < / div >

you can try. I don't know if you said "return the corresponding value"

.

I see what you mean. We usually use Filter, a Filter function, {{state | stateFilter}} function
to write Filter function
stateFilter (val) {

in fileter.
const arr=[''];
return arr[val];

}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c669-2b052.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c669-2b052.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?