vue-search-select
vue-search-select copied to clipboard
how do i use data from getJSON()?
i'm trying to figure out how to use an endpoint data to populate the dropdown. i have the following code
mounted () { $.getJSON('/occupations/search-select', json => { this.occupations = json.data console.log(json.data) } }
how should my data() look like? i'm not that great with front end stuff but i'm trying. is this the correct approach or is there another way to do it? thanks.