Breadcrumb

less than 1 minute read

References

TypeScript

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

// Create the breadcrumb
let el = document.querySelector("#breadcrumb");
let breadcrumb = Components.Breadcrumb({
    el: el,
    items: [
        { text: "Root", href: "/" },
        { text: "Web 1", href: "/web" },
        { text: "Web 1-1", href: "/web/1" }
    ]
});

React

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

export class IDemo extends React.Component {
    // Render the component
    render() {
        return (
            <Breadcrumb
                items={[
                    { text: "Root", href: "/" },
                    { text: "Web 1", href: "/web" },
                    { text: "Web 1-1", href: "/web/1" },
                ]}
            />
        );
    }
}

VueJS

<template>
    <Breadcrumb v-bind:items="demoItems" />
</template>

<script>
import { Breadcrumb } from "gd-sprest-bs-vue";
export default {
    components: { Breadcrumb },
    data() {
        return {
            demoItems: [
                { text: "Root", href: "/" },
                { text: "Web 1", href: "/web" },
                { text: "Web 1-1", href: "/web/1" },
            ]
        };
    }
}
</script>

Code Playground