Pagination

less than 1 minute read

References

TypeScript

import { Components } from "gd-sprest-bs";

// Create the pagination
let el = document.querySelector("#pagination");
let pagination = Components.Pagination({
    el: el,
    numberOfPages: 5,
    onClick: (index, ev) => {
        // Log the index
        console.log("The page number selected is: " + index);
    }
});

React

import * as React from "react";
import { Pagination } from "gd-sprest-bsx";

export class IDemo extends React.Component {
    // Render the component
    render() {
        return (
            <Pagination
                numberOfPages={5}
            />
        );
    }
}

VueJS

<template>
    <Pagination numberOfPages="5" />
</template>

<script>
import { Pagination } from "gd-sprest-bs-vue";
export default {
    components: { Pagination }
}
</script>

Code Playground