Created
August 6, 2019 21:36
-
-
Save Jexordexan/54a6696e0e4e51fc5273fb25dd7207c2 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 sort = state({ | |
field: 'created_at', | |
reverse: false, | |
}) | |
function changeSort(field: string, reverse: boolean) { | |
sort.field = field | |
sort.reverse = reverse | |
} | |
return { sort, changeSort } | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment