-
I want to append an element to a specific element when the user clicks the button. The scenario goes like this. Is there another way to deal with that kind of problem? <table>
<tbody>
<tr>
<td>
One
<button>delete</button>
<button x-on:click="edit(passIdToFunc)">edit</button>
</td>
</tr>
<tr id="one" style="display: hidden"></tr>
<!-- append x-teleport dom node to here when current value is id = one -->
<tr>Two</tr>
<tr id="two" style="display: hidden"></tr>
<tr>Three</tr>
<tr id="three" style="display: hidden"></tr>
...
</tbody>
</table>
<!--
For the initial render, or if there is no table data,
I would like to append it to somewhere else with display none.
-->
<template x-teleport="computedString">
...
</template> |
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Jul 4, 2022
Replies: 1 comment 1 reply
-
I don't think it's possible, the value of x-teleport doesn't get evaluated, it's just a normal query selector |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
phyothiha
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think it's possible, the value of x-teleport doesn't get evaluated, it's just a normal query selector