-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cde378
commit 5adb27d
Showing
13 changed files
with
288 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
title: Usage | ||
--- | ||
|
||
# {{$frontmatter.title}} | ||
|
||
The standard behavior of `vue-semantic-structure` defines the most common approach for the use of HTML structure components. | ||
|
||
In this structure, the main content contains different modules *(example: Stage (Hero), Text-Image, Gallery, etc.)*. | ||
|
||
The main structure is in the `<main>` tag, which contains the main components. | ||
|
||
::: code-group | ||
|
||
```html [HTML] | ||
<main> | ||
<header class="hero">…</header> | ||
<section class="text-image">…</section> | ||
<section class="gallery">…</section> | ||
</main> | ||
``` | ||
|
||
```vue [Vue] | ||
<template> | ||
<ContentContainer> | ||
<header class="hero">…</header> | ||
<ContentContainer class="text-image">…</ContentContainer> | ||
<ContentContainer class="gallery">…</ContentContainer> | ||
</ContentContainer> | ||
</template> | ||
``` | ||
|
||
::: | ||
|
||
## Advance Usage | ||
|
||
The behavior of the `ContentContainer` can also be adapted for blog article pages. | ||
|
||
Here, an `<article>` is often used in the `<main>` tag, for which the `ContentContainer` must be adapted. | ||
|
||
The `rootTags` property must be extended by an `<article>` (e.g. `['main', 'article']`). | ||
|
||
It is recommended to create a separate component that extends the `ContentContainer`. | ||
|
||
### `CustomContentContainer.vue` | ||
|
||
```vue | ||
<template> | ||
<ContentContainer :root-tags="['main', 'article']"> | ||
<slot /> | ||
</ContentContainer> | ||
</template> | ||
<script setup> | ||
import { ContentContainer } from 'vue-semantic-structure'; | ||
</script> | ||
``` | ||
|
||
In comparison to the basic application, the entire content is enclosed in another `CustomContentContainer` (e.g. `ContentContainer`), which represents the `<article>` tag. | ||
|
||
::: code-group | ||
|
||
```html [HTML] | ||
<main> | ||
<article> | ||
<header class="hero">…</header> | ||
<section class="text-image">…</section> | ||
<section class="gallery">…</section> | ||
</article> | ||
</main> | ||
``` | ||
|
||
```vue [Vue] | ||
<template> | ||
<CustomContentContainer> | ||
<CustomContentContainer> | ||
<header class="hero">…</header> | ||
<CustomContentContainer class="text-image">…</CustomContentContainer> | ||
<CustomContentContainer class="gallery">…</CustomContentContainer> | ||
</CustomContentContainer> | ||
</CustomContentContainer> | ||
</template> | ||
``` | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...rc/components/DefaultContentContainer.vue → .../src/components/BasicContentContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.