slidev icon indicating copy to clipboard operation
slidev copied to clipboard

[v-clicks] `depth` parameter

Open TheAlexLichter opened this issue 3 years ago β€’ 2 comments

Is your feature request related to a problem? Please describe. When using the <VClicks> component or the corresponding directive with nested lists (see example for one below), then only the top-level elements will be "keyed" for clicks.


Example list

  • Entry 1
  • Entry 2
    • Entry 2a
    • Entry 2b
      • Entry 2bA
  • Entry 3

It'd lead to three clicks and the reveal order would be Entry 1, Entry 2 and all sublists, Entry 3. There is no way to "key" sublists individually or make them open one-by-one as well.

Describe the solution you'd like Instead of adding the directive manually there, a depth attribute for the component (or value/attribute for the directive) would be desirable IMO. The value would be 1 by default to keep the current behavior.

  • depth=2 would have the following order: Entry 1, Entry 2, Entry 2a, Entry2b with sublist (Entry 2bA), Entry 3
  • depth=3 would have the following order: Entry 1, Entry 2, Entry 2a, Entry2b, Entry 2bA, Entry 3

Describe alternatives you've considered A suitable option would be applying v-click manually (what I tend to do at the moment). This is fine but a depth param would add more convenience πŸ˜‹

Another alternative to the depth parameter would be adding v-click to each subitem (of lists). But this is less configurable and also changes the standard behavior

TheAlexLichter avatar Apr 24 '22 19:04 TheAlexLichter

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 14 '22 17:09 stale[bot]

Not stale ☺️

TheAlexLichter avatar Sep 15 '22 08:09 TheAlexLichter

Strongly second this!

ChiMaoShuPhy avatar Oct 01 '22 06:10 ChiMaoShuPhy

Would this be a duplicate of https://github.com/slidevjs/slidev/issues/362?

AustinGil avatar Oct 27 '22 15:10 AustinGil

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 26 '22 16:12 stale[bot]

Would this be a duplicate of #362?

Yes and no. Definitely related but not strictly a duplicate I'd say

TheAlexLichter avatar Dec 26 '22 21:12 TheAlexLichter

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 24 '23 22:02 stale[bot]

not stale πŸ‘€

TheAlexLichter avatar Feb 25 '23 10:02 TheAlexLichter

Noo stale bot. Why πŸ™ˆ

TheAlexLichter avatar Mar 04 '23 11:03 TheAlexLichter

@manniL it works in v0.40.5! Thanks @tonai I needed this today and saw it just released.

BretFisher avatar Mar 24 '23 05:03 BretFisher

Indeed, resolved by https://github.com/slidevjs/slidev/pull/893 πŸ‘πŸ»

TheAlexLichter avatar Mar 24 '23 10:03 TheAlexLichter

Just in time :sweat_smile:

tonai avatar Mar 24 '23 14:03 tonai