Replies: 1 comment 1 reply
-
|
You can't set Two ways, both keep the count in the component (no frontmatter needed):
Verified on Slidev's clicks context (createClicksContextBase, client v52): registering |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TLDR: Is it possible to mutate the total number of clicks for a slide via javascript inside a vue component? This would let me manage the number of clicks to progress a slide in one place (the vue component) instead of spreading it out between the
slides.mdand the component that contains the different click states.Longer Explanation:
I'm working on a presentation on NAND gates and how they combine to create a CPU. To accomplish this I need a lot of diagrams, but I need to be able to have a single slide with a diagram with colors that change as I talk. So for a simple example, when describing an AND gate I want to have both wires off, then one wire red to signal it being on, hten the other wire on to signal both inputs on (with the output wire then colored to show the AND functionality).
The way I'm accomplishing now is I have a generic
Diagram.vuecomponent that has theonSlideEnter()infrastructure with apropof asetup()function that can be passed in as well as asetClickState()prop.Then each individual slide has it's own Vue component which manages it's own
setup()andsetClickState()function to set up the diagram for that specific slide.If a slide has a total number of clicks greater than zero, than each click ends up calling
setClickState()with the current click number.This works great and properly works for backwards and forwards navigation. The problem is that I have to set each slide with
on the markdown section, but the number of clicks required for all the different diagram states is really determined by the vue component. If I add a new click state for a new scenario to describe, i have to remember to go back to the
slides.mdand update it to match. Same if I remove a scenario from the component.Is there an easier way for me to manage this? I don't see anything in
useSlidecontext()that allows me to set click info (though I am able to get total click count).Beta Was this translation helpful? Give feedback.
All reactions