Skip to content

🧠 Advanced Use Cases of WBC-Routes2 ​

Once you master the fundamentals, WBC-Routes2 opens up unlimited flexibility. You’re no longer tied to static Vue views or hardcoded layouts. Let’s walk through several real-world use cases that show off the true power of this system.


πŸ“„ 1. Route-as-Documentation ​

Create documentation pages from Markdown without declaring components.

js
{
  path: "/docs/install",
  name: "DocsInstall",
  component: WBC,
  props: {
    item: "./docs/install.md"
  }
}

β†’ Add SEO with route meta:

js
meta: {
  title: "Install Guide – WBC-Routes2",
  description: "Step-by-step install instructions for WBC-Routes2.",
  "og:title": "Install Guide",
  "twitter:card": "summary"
}

πŸŽ›οΈ 2. Configurable Dashboards ​

Imagine this config coming from a CMS or external config file:

js
{
  path: "/dashboard",
  component: WBC,
  props: {
    item: [
      "<~VContainer|pa-5>",
      {
        comp: "VCard",
        options: {
          class: "blue white--text pa-3",
          html: "πŸ’‘ Welcome to your dashboard!"
        }
      },
      {
        comp: "WBDataViewer",
        options: {
          value: { cpu: "2.3GHz", ram: "8GB", user: "Wissem" }
        }
      }
    ]
  }
}

πŸ” 3. Confidential Views (Encrypted) ​

Send personalized dashboards to logged-in users via encrypted route props.

js
{
  path: "/private/:item",
  component: WBC,
  props: route => ({
    item: JSON.parse(
      decompressFromEncodedURIComponent(route.params.item)
    )
  }),
}

β†’ A backend or client compresses full Vue+Markdown content into a secure link.


🌐 4. Multi-language Page Builder ​

Use language-based dynamic props to show content in the user’s preferred language:

js
{
  path: "/about",
  name: "AboutPage",
  component: WBC,
  props: {
    item: {
      en: "./content/about.en.md",
      fr: "./content/about.fr.md",
      ar: "./content/about.ar.md"
    }
  }
}

β†’ Combine with dynamic metadata per locale.


🧩 5. Embedding UI Kits ​

Use WBC-Routes2 to embed Vuetify or Bootstrap widgets directly inside Markdown:

markdown
<!-- [[[BButton__Click me!|primary]]] -->
<!-- [[[VAlert__This is a Vuetify alert|success]]] -->
"""

β†’ These buttons and alerts can also be wrapped into WBC layouts like cards or columns.

---

## πŸ“¦ 6. Component Previews from NPM Docs

Say you're documenting a custom Vue component library:

```js
{
  path: "/components/my-button",
  component: WBC,
  props: {
    item: [
      "<~VCard|pa-3>",
      {
        comp: "MyButton",
        options: { text: "Test Me", class: "primary" }
      },
      {
        comp: "code",
        options: { html: "<MyButton text='Test Me' />" }
      }
    ]
  }
}

β†’ Perfect for living component libraries!


πŸ“„ 7. Nested Views from JSON ​

Use dynamic routes to pass in nested view data (e.g. from a CMS API or file):

js
{
  path: "/nested/:item",
  name: "NestedUI",
  component: WBC,
  props: route => ({
    item: JSON.parse(
      decompressFromEncodedURIComponent(route.params.item)
    )
  })
}

β†’ The item could be deeply structured, with nested VCards, Markdown blocks, or dynamic behavior.


🧠 8. Teaching or LMS Platforms ​

Create interactive lessons using WBC + Markdown:

  • Embed multiple-choice quizzes
  • Show/hide answers
  • Dynamically switch difficulty
  • Use route metadata for accessibility

πŸ”„ 9. Interactive JSON Forms ​

js
{
  comp: "VForm",
  dive: true,
  options: {
    html: [
      {
        comp: "VTextField",
        options: {
          label: "Name",
          placeholder: "Enter your name"
        }
      },
      {
        comp: "VTextField",
        options: {
          label: "Email",
          placeholder: "Enter your email"
        }
      },
      {
        comp: "VBtn",
        options: {
          html: "Submit",
          class: "success",
          on: {
            click: that => () => alert("Form submitted!")
          }
        }
      }
    ]
  }
}

β†’ Dynamically rendered in route props as JSON!


βœ… Summary ​

WBC-Routes2 empowers developers to:

  • Build entire views as data not .vue files
  • Customize each route’s language, layout, SEO, interactivity
  • Embed video, images, Markdown, or Vue components anywhere
  • Create one-link previews or dashboards without Vue builds
  • Support CMS, dashboards, education platforms, or doc sites