Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

HELP How to create an isolate section with some css and javascript inside #3969

Closed
NatachaH opened this issue Jun 18, 2024 · 3 comments
Closed

Comments

@NatachaH
Copy link

Hi,

I want to create a section where I can put some demo code that is isolated from the default layout.

The section must:

  • Have it's own css layout
  • Have some vanilla javascript interaction with the DOM

I installed the Whyframe plugin, and followed the steps to create the iframe.

I figured how to make my css work (it's ugly but it work), but nothing work for my javascript code and I don't understand how to make it work (or if it's even possible ?)

My code work when I preview on DEV mode (npm run docs:dev) but nothing work when I deploy with (npm run docs:build)...

@brc-dd
Copy link
Member

brc-dd commented Jun 18, 2024

ah just create an iframe? whyframe is only needed if you need to render vue 👀

@NatachaH
Copy link
Author

NatachaH commented Jun 18, 2024

@brc-dd yeah that what i faught but when i tried to add the src to the iframe, it load a Vitepress 404 error page ...

EDIT: Ok I figured how to display a custom HTML page by placing the source code into the public folder. But is there a way to use it as Whyframe with a SLOT area to re-use the iframe with different code exemple ?

@brc-dd
Copy link
Member

brc-dd commented Jun 27, 2024

Sorry, I've no idea. Maybe someone will need to write a whyframe like plugin but for html 👀

@vuejs vuejs locked and limited conversation to collaborators Jun 27, 2024
@brc-dd brc-dd converted this issue into discussion #3991 Jun 27, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants