Appearance
π§ 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
.vuefiles - 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