Created
August 6, 2019 21:37
-
-
Save Jexordexan/1b1e26558374c4ebfa9826ff94ecb755 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
import { value, createComponent } from 'vue-function-api' | |
export default createComponent({ | |
props: /* ... */, | |
setup(props) { | |
const sortField = value('created_at') | |
const reverse = value(false) | |
function changeSort(field: string, reverse: boolean) { | |
sortField.value = field | |
reverse.value = reverse | |
} | |
return { sortField, reverse, changeSort } | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment