Appearance
π― Route Props in WBC-Routes2 β
One of the most powerful features of WBC-Routes2 is the ability to pass any kind of prop to the WBC component within a route. This includes strings, arrays, objects, Markdown, HTML, Vue components, even dynamically encrypted props.
β
Basic String as item Prop β
You can pass raw Markdown or HTML directly as a prop to WBC.
js
{
path: "/simple",
name: "SimpleRoute",
component: WBC,
props: {
item: "## π§ͺ Hello from Markdown!"
}
}π Loading Markdown File β
Pass a relative path to a .md file (available in public or build root):
js
{
path: "/doc",
name: "DocPage",
component: WBC,
props: {
item: "./md/docs/guide.md"
}
}π Array of Props β
If you want to render multiple components or Markdown sections, you can use an array of props:
js
{
path: "/array-content",
name: "ArrayRoute",
component: WBC,
props: {
item: [
"MD__## Section A",
"<div class='info'>Some HTML</div>",
"./md/docs/chapter1.md"
]
}
}π§© Full WBC Object as Prop β
You can pass an object to fully configure the WBC rendering behavior:
js
{
path: "/object",
name: "ObjectRoute",
component: WBC,
props: {
item: {
comp: "MD",
options: {
class: "pa-4 teal lighten-5",
html: "# π§ Dynamic from Object"
}
}
}
}π Multilingual Props β
WBC-Routes2 supports multilingual content out-of-the-box. Just provide an object keyed by language codes:
js
{
path: "/multilang",
name: "MultilangRoute",
component: WBC,
props: {
item: {
en: "## Hello",
fr: "## Bonjour",
ar: "## Ω
Ψ±ΨΨ¨Ψ§"
}
}
}If your app uses i18n, the right language version will be picked automatically.
π§ Combining Mixed Content β
You can mix file paths, inline Markdown, WBC objects, and Vue components:
js
{
path: "/mixed",
name: "MixedProps",
component: WBC,
props: {
item: [
"<~VContainer|pa-5 grey>",
{
comp: "VCard",
options: {
class: "pa-3",
html: "π Mixed content inside a card"
}
},
"MD__### Inline Markdown",
"./md/docs/summary.md"
]
}
}π‘οΈ Prop Validation (Optional) β
Although Vue Router itself doesnβt enforce prop types, you can add basic validation via Vue's props config inside the WBC component or wrapper layout.
π Summary β
| Type | Supported | Notes |
|---|---|---|
| Raw Text | β | Markdown or HTML |
| Markdown File | β | Relative path |
| Object with comp/options | β | Full dynamic rendering |
| Multilingual Object | β | i18n-aware |
| Array of Mixed Content | β | Combine any format |
| JSON or Config Blocks | β | Advanced, requires correct structure |