Get inner html from Vue <Template> tag

Hello!,

Continuing from a previous topic here, I am looking at how to extract html code from a Vue template.

The source:

<template>
  <div class="p-2 mx-4 mt-4">
    <HeaderMenu />
    <button id="increment" class="p-2 mt-4 text-2xl font-bold text-white bg-green-500 rounded">+</button>
    <button id="decrement" class="p-2 mt-4 ml-4 text-2xl font-bold text-white bg-red-500 rounded">-</button>
    <span id="counter" class="p-2 mt-4 ml-4 text-2xl font-bold text-white bg-blue-500 rounded">0</span>
  </div>
</template>

<script>
  ...
</script>

I want to extract the child div and it’s contents, something like get_inner_html or get_children, but I don’t see anything like that searching the Seed source code.

Is this something I can do with Seed? Or should I look elsewhere for this operation?

Do I understand correctly that you have a Vue template as a String and you want to extract a substring that contains HTML?
If so, I would try to use a jQuery-like library - something like:

It should allow you to extract the needed HTML nodes using CSS-like selectors.

Note: I don’t know how big those libs are after compilation and if they are fully WASM-compatible.

Thank you for the suggestions, they are immensely helpful! :smiley: