My input-select as below,
<input-select v-model="county" id="county" :options="getCountyList()">
† County
</input-select>
My function getCountyList() as below,
getCountyList: function () {
var retarr = [];
for (let i = 0; i < json.length; i++) {
if (json[i].state_id == this.state) {
// here STATE selected in previous drop down,
// match it with state from json and get COUNTY
retarr[i] = json[i].county_name;
}
}
const mySet = new Set(retarr); //remove duplicates and get DISTINCT County list
console.log("this is mySet COUNTY return array :", mySet);
return mySet;
};
console.log ("this is mySet COUNTY return array :",mySet ) returns as below:
0: undefined
1: "St. Clair"
2: "Jefferson"
3: "Shelby"
4: "Tallapoosa"
5: "Blount"
6: "Talladega"
7: "Marshall"
8: "Cullman"
9: "Bibb"
10: "Chilton"
11: "Walker"
Now, my problem is v-model="county" is getting key i.e. 1,2,3 instead of COUNTY Name after selection. How can I get the COUNTY NAME there?