Skip to content

Instantly share code, notes, and snippets.

@ediamin
Created March 16, 2018 14:58
Show Gist options
  • Save ediamin/4c17be0abe18f9989b669bc558cc3350 to your computer and use it in GitHub Desktop.
Save ediamin/4c17be0abe18f9989b669bc558cc3350 to your computer and use it in GitHub Desktop.
Example of vue computed property
data() {
return {
questions: [
{
...
},
{
...
}
...
]
};
},
computed: {
sortedQuestions() {
return this.questions.sort((a, b) => {
// write your code
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment