Skip to content

Instantly share code, notes, and snippets.

@iErik
Created April 7, 2020 13:44
Show Gist options
  • Save iErik/20ec61e3e117c7221deaecd8af73c9a2 to your computer and use it in GitHub Desktop.
Save iErik/20ec61e3e117c7221deaecd8af73c9a2 to your computer and use it in GitHub Desktop.
<template>
<f-display-per-page :options="options" :change="updateSelected" />
</template>
<script>
export default {
data: () => ({ selected: 10 }),
computed: {
options() {
const items = [
{ label: 10, value: 10, selected: this.selected === 10 },
{ label: 25, value: 25, selected: this.selected === 25 },
{ label: 50, value: 50, selected: this.selected === 50 }
]
return items
}
},
methods: {
updateSelected({ value }) {
this.selected = value
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment