Skip to content

Instantly share code, notes, and snippets.

@ChadTaljaardt
Created October 15, 2016 21:42
Show Gist options
  • Save ChadTaljaardt/6519385d98701285d731b15f01ce307a to your computer and use it in GitHub Desktop.
Save ChadTaljaardt/6519385d98701285d731b15f01ce307a to your computer and use it in GitHub Desktop.
<option v-for="option in country" v-bind:value="option.nicename">
{{ option.nicename }}
</option>
<script>
export default {
/*
* The component's data.
*/
data() {
return {
name : '',
url : '',
trafficsource: '',
country: [],
costmodel: '',
destination: '',
cost: '',
redirect: ''
};
},
/**
* Prepare the component (Vue 1.x).
*/
ready() {
this.prepareComponent();
},
/**
* Prepare the component (Vue 2.x).
*/
mounted() {
this.prepareComponent();
},
methods: {
/**
* Prepare the component (Vue 2.x).
*/
prepareComponent() {
this.getCountries();
},
getCountries() {
this.$http.get('/api/countries')
.then(response => {
this.$set(this.$data, 'country', response.data)
console.log(this.$data.country);
});
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment