Skip to content

Commit

Permalink
fix(control): add missing emits on pagination and include in mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
kiaking committed Dec 27, 2023
1 parent c1e5124 commit 30b8ccd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/components/SControlPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ defineProps<{
perPage: number
}>()
defineEmits<{
(e: 'prev'): void
(e: 'next'): void
}>()
const size = useControlSize()
const position = useControlPosition()
</script>
Expand All @@ -21,6 +26,8 @@ const position = useControlPosition()
:total="total"
:page="page"
:per-page="perPage"
@prev="$emit('prev')"
@next="$emit('next')"
/>
</div>
</template>
3 changes: 3 additions & 0 deletions lib/mixins/Control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SControlButton from '../components/SControlButton.vue'
import SControlCenter from '../components/SControlCenter.vue'
import SControlInputSearch from '../components/SControlInputSearch.vue'
import SControlLeft from '../components/SControlLeft.vue'
import SControlPagination from '../components/SControlPagination.vue'
import SControlRight from '../components/SControlRight.vue'
import SControlText from '../components/SControlText.vue'

Expand All @@ -15,6 +16,7 @@ export function mixin(app: App): void {
app.component('SControlCenter', SControlCenter)
app.component('SControlInputSearch', SControlInputSearch)
app.component('SControlLeft', SControlLeft)
app.component('SControlPagination', SControlPagination)
app.component('SControlRight', SControlRight)
app.component('SControlText', SControlText)
}
Expand All @@ -27,6 +29,7 @@ declare module 'vue' {
SControlCenter: typeof SControlCenter
SControlInputSearch: typeof SControlInputSearch
SControlLeft: typeof SControlLeft
SControlPagination: typeof SControlPagination
SControlRight: typeof SControlRight
SControlText: typeof SControlText
}
Expand Down

0 comments on commit 30b8ccd

Please sign in to comment.