Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge docs/main into docs-ru/main @ 87e46ef5 #42

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
152e0f6
docs: typo in sidebar (#43)
mathieutu Nov 15, 2021
ad008f0
docs: typos in code (#45)
posva Nov 17, 2021
5d92892
docs: typo (#44)
posva Nov 17, 2021
c393c03
chore: typo (#46)
cheesi Dec 3, 2021
fbc97d8
docs: fix typo (#47)
Deckluhm Dec 8, 2021
a261c23
chore: typo (#48)
tkgroot Dec 20, 2021
06ae275
feat: add TOC documentation (#49)
tonai Jan 17, 2022
ce73d58
fix: broken links (#50)
chengpeiquan Jan 18, 2022
4890d42
Minor notation change (#51)
p1atdev Feb 6, 2022
d99ebc3
feat: add ja trans
antfu Feb 7, 2022
e89a81b
docs: add favicon frontmatter configure (#53)
alexanderdavide Feb 14, 2022
871a293
docs: update shiki URL (#54)
ashramwen Feb 16, 2022
5b4af78
Add slidev-theme-academic (#55)
alexanderdavide Mar 7, 2022
61b06f2
Add showcase Git's Most Wanted (#56)
alexanderdavide Mar 7, 2022
e9cccdb
feat: update install.md to fix the missed docker part (#57)
tangramor Mar 16, 2022
1abac97
Update install.md to fix typos about docker section (#58)
tangramor Mar 16, 2022
b18d6f4
docs: add custom-nav-controls documents (#60)
LarchLiu Mar 22, 2022
d68398a
docs: add mention to --dark option when exporting (#61)
ruyadorno Mar 25, 2022
9fa6829
fix: correct typo in the name of the generated pdf (#62)
twitwi Apr 13, 2022
7308799
Document parameter listClass of Toc (#63)
alexanderdavide Apr 14, 2022
0daa359
feat: add doc for Titles and Link components (#64)
tonai Apr 14, 2022
37797ff
feat: update config doc (#65)
tonai Apr 15, 2022
0305762
docs: update previews of slidev-theme-academic (#66)
alexanderdavide Apr 25, 2022
87e46ef
feat: add doc for CLI commands (#67)
tonai May 19, 2022
7b1286c
docs(en): merging all conflicts
docschina-bot May 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: add custom-nav-controls documents (#60)
  • Loading branch information
LarchLiu authored Mar 22, 2022
commit b18d6f476b18393dabf793d2f08d22f243683948
25 changes: 24 additions & 1 deletion custom/global-layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

Global layers allow you to have custom components that **persistent** across slides. This could be useful for having footers, cross-slides animations, global effects, etc.

Slidev provides two layers for this usage, create `global-top.vue` or `global-bottom.vue` under your project root and it will pick up automatically.
Slidev provides three layers for this usage, create `global-top.vue`, `global-bottom.vue` or `custom-nav-controls.vue` under your project root and it will pick up automatically.

Layers relationship:

- Global Top (`global-top.vue`)
- Slides
- Global Bottom (`global-bottom.vue`)
- NavControls
- Customized Navigation Controls (`custom-nav-controls.vue`)

## Example

Expand All @@ -23,6 +25,17 @@ Layers relationship:

The text `Your Name` will appear to all your slides.

```html
<!-- custom-nav-controls -->
<template>
<button class="icon-btn" title="Next" @click="$slidev.nav.next">
<carbon:arrow-right />
</button>
</template>
```

The button `Next` will appear in NavControls.

To enabled it conditionally, you can apply it with the [Vue Global Context](/custom/vue-context).

```html
Expand Down Expand Up @@ -60,3 +73,13 @@ To enabled it conditionally, you can apply it with the [Vue Global Context](/cus
</footer>
</template>
```

```html
<!-- custom-nav-controls -->
<!-- hide the button in Presenter model -->
<template>
<button v-if="!$slidev.nav.isPresenter" class="icon-btn" title="Next" @click="$slidev.nav.next">
<carbon:arrow-right />
</button>
</template>
```