Skip to content

Instantly share code, notes, and snippets.

@qq7
Last active December 17, 2016 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qq7/df65e43d741eef695b04ce0ab9011dc0 to your computer and use it in GitHub Desktop.
Save qq7/df65e43d741eef695b04ce0ab9011dc0 to your computer and use it in GitHub Desktop.
<template>
<div class="test">
<p>{{question.answer}}</p>
<p>{{question}}</p>
<span v-for="yo in splitLetters">{{yo}}</span>
</div>
</template>
<script>
export default {
data() {
return {
question: [],
};
},
created() {
this.$http.get('http://jservice.io/api/random').then((response) => {
console.log(`Yo! ${response.data}`);
this.question = response.data[0];
this.total += 1;
});
},
computed: {
splitLetters() {
return this.question.answer.split('');
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment