svelte icon indicating copy to clipboard operation
svelte copied to clipboard

Multiple variabels in `{#key}`

Open Addeuz opened this issue 1 year ago • 4 comments

Describe the problem

I want to use multiple variables in a {#key variable} like this:

Describe the proposed solution

{#key variable1, variable2, variable3}
  ...
{/key}

Alternatives considered

I have four variables that I want to use in key blocks.

So what I have done right now is this:

{#key variable1}
  {#key variable2}
    {#key variable3}
      {#key variable4}
        ....
      {/key}
    {/key}
  {/key}  
{/key}

Importance

nice to have

Addeuz avatar Mar 20 '23 13:03 Addeuz

~This already works. If not, please provide a REPL. Using the comma operator turns (variable1, variable2, variable3) into a single expression and the block should update when the expression (any of the variables) changes.~

I'm sorry, I was confused. See the linked issue below.

Prinzhorn avatar Mar 20 '23 16:03 Prinzhorn

Also https://github.com/sveltejs/svelte/issues/7793

Prinzhorn avatar Mar 20 '23 16:03 Prinzhorn

Your REPL in that issue seems interesting, we could do that until this is implemented

Addeuz avatar Mar 20 '23 18:03 Addeuz

This seems to works with the following:

{#key [variable1, variable2, variable3]}
  ...
{/key}

andirady avatar Mar 24 '23 21:03 andirady