Skip to content

[RRFC] Support v-if v-else-if v-else #46

@mantou132

Description

@mantou132
  • I searched for an existing RRFC which might be relevant to my RRFC

Motivation

Simplify conditional templates

Example

html`
      <div v-if=${isEmpty} class="placeholder">${this.placeholder}</div>
      <div v-else-if=${!this.multiple} class="value">${currentLabels}</div>
      <dy-scroll-box v-else class="values">
        ${typeof currentLabels?.at(0) === 'object' ? currentLabels : currentLabels?.join(', ')}
      </dy-scroll-box>
    `

How

Implemented in the _clone method of TemplateInstance

Current Behavior

Desired Behavior

References

  • n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions