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

[next] add global slot for layout #760

Closed
4 tasks done
userquin opened this issue Jun 9, 2022 · 1 comment · Fixed by #812
Closed
4 tasks done

[next] add global slot for layout #760

userquin opened this issue Jun 9, 2022 · 1 comment · Fixed by #812
Labels
enhancement New feature or request theme Related to the theme

Comments

@userquin
Copy link
Collaborator

userquin commented Jun 9, 2022

Is your feature request related to a problem? Please describe.

I need to add a prompt dialog and there is no way to add it only once.

I need to add the component to some home slot and also to a content slot.

Since the prompt is shown using position fixed I need to use also Teleport to move the component to the body.

Describe the solution you'd like

Instead adding the component twice just provide a layout slot to be included under the layout element.

Describe alternatives you've considered

No response

Additional context

The use case is for example when using PWA with prompt for update.

You can check the PR on the vite plugin pwa repo for New theme, check the index module on docs/.vitepress/theme folder and the ReloadPrompt.vue on components folder.

Validations

@userquin userquin changed the title [next] add global global slots for layout [next] add global slot for layout Jun 9, 2022
@kiaking
Copy link
Member

kiaking commented Jun 14, 2022

Sounds good. Maybe we add slot named:

  • layout-top
  • layout-bottom
<!-- Layout.vue -->
<template>
  <div class="Layout">
    <slot name="layout-top" />

    ...

    <VPFooter />

    <slot name="layout-bottom" />
  </div>
</template>

@kiaking kiaking added enhancement New feature or request theme Related to the theme labels Jun 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request theme Related to the theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants