Created
October 15, 2016 21:42
-
-
Save ChadTaljaardt/6519385d98701285d731b15f01ce307a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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