Last active
December 17, 2016 22:07
-
-
Save qq7/df65e43d741eef695b04ce0ab9011dc0 to your computer and use it in GitHub Desktop.
This file contains 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
<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