Created
March 16, 2018 14:58
-
-
Save ediamin/4c17be0abe18f9989b669bc558cc3350 to your computer and use it in GitHub Desktop.
Example of vue computed property
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
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