Existing data 1 shipTypes
{
"Destroyer": "驅逐艦",
"AirCarrier": "航空母艦",
"Battleship": "主力艦",
"Cruiser": "巡洋艦"
}
and data 2 shipTypeImages
{
"Destroyer": {
"image": "http://glossary-asia-static.gcdn.co/icons/wows/current/vehicle/types/Destroyer/normal.png",
},
"AirCarrier": {
"image": "http://glossary-asia-static.gcdn.co/icons/wows/current/vehicle/types/AirCarrier/normal.png",
},
"Battleship": {
"image": "http://glossary-asia-static.gcdn.co/icons/wows/current/vehicle/types/Battleship/normal.png",
},
"Cruiser": {
"image": "http://glossary-asia-static.gcdn.co/icons/wows/current/vehicle/types/Cruiser/normal.png",
}
}
Vue DOM structure (pug syntax)
ul
li
img {{shipTypeImages.image}}
span {{shipTypes.value}}
How do I match the Key values of two data (such as "Destroyer") with the data, as shown in the following example?
Destroyer
Aircraft carrier
Battleship
Cruiser
Thanks!
Two arrays foreach loop to form a new array to render to the page
Or use computed properties
...