Skip to content

Allow to encapsulate multiple tags having the same directive within a <template> tag#78

Description

@mlbiche

In order to lighten the following code:

<p :if="state.counter < 5">1</p>
<p :if="state.counter < 5">2</p>
<p :if="state.counter < 5">3</p>
<p :if="state.counter < 5">4</p>
<p :if="state.counter < 5">5</p>

we would prefer having the following syntax:

<template :if="state.counter < 5">
  <p>1</p>
  <p>2</p>
  <p>3</p>
  <p>4</p>
  <p>5</p>
</template>

Currently, the <template> tag is inserted in the DOM, resulting in the <p> tags not being displayed. It would be nice if LEGO would directly insert in the DOM the <p> tags.

Sure, we still can do:

<div :if="state.counter < 5">
  <p>1</p>
  <p>2</p>
  <p>3</p>
  <p>4</p>
  <p>5</p>
</div>

But for the few nerds in this world that (as I do) still attach importance to lightening the DOM and dissociating the logic from the template structure and that have allergic reactions to <div> Christmas trees, it would be nice to be able to use the <template> tag as previously mentioned.

Let's see in the future if this feature is worth investing time and complexity in it. For now, I can live with it! 馃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions