Skip to content

JSONTable

A Vue component that renders a table from a JSON array. The table is sortable by column and has customizations for certain field types.

Do initial installation first

Before you follow any of the guides below, you should import and install this project in your VitePress site.

Installation

  1. Install the package, if you haven't already.

  2. Import the component in docs/.vitepress/theme/index.ts (or equivalent)

    ts
    import { JSONTable } from '@cynber/vitepress-valence'
    
    export default {
      enhanceApp({ app, router, siteData }) {
        app.component('JSONTable', JSONTable) 
      }
    } satisfies Theme

See the next page for examples.