Skip to content
Discussion options

You must be logged in to vote

You can use a span tag

<template  x-for="item in filteredItems" :key="item">
  <li>
    <span x-text="item"></span>
    <button>test</button>
  </li>
</template>

Re So I guess x-text shd only set the text not the whole content of an element. how would you decide where to put the text?
<li>item1<button>test1</button><li> vs <li><button>test1</button>item1<li> vs <li><button>test1</button>item1<button>test1again</button><li>
It would just open a can of worms because different devs have different use cases.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@florian-sun
Comment options

@ekwoka
Comment options

@florian-sun
Comment options

@SimoTod
Comment options

SimoTod Oct 17, 2024
Collaborator

Answer selected by florian-sun
@florian-sun
Comment options

@ekwoka
Comment options

@florian-sun
Comment options

@ekwoka
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants