Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
How to define properties in nested Vue3 compiling dynamic-html?

I'm trying to use Vue compiler to render dynamic HTML texts; I have implemented this component:

app.component("dyno-html", {
  props: ["htmlTxt"],
  setup(props) {
    const textCompRef = computed(() => ({ render: compile(props.htmlTxt) }));
    return () => h(textCompRef.value);
  },
});

I have succeeded in doing so, in one level. Like the code below, and it works fine.

<template>
  <div class="home">
    <dyno-html :htmlTxt="htmlTest"></dyno-html>
  </div>
</template>

<script>
export default {
  name: "Home",
  components: {},
  data: function() {
    return {
      htmlTest: "<H1>Test</H1>",
    }
  }
}
</script>

I'm trying to add a second layer in a nested manner:

htmlTest: "<h1>Test</h1><dyno-html :htmlTxt='htmlTest2'></dyno-html>",
htmlTest2: "<h2>Test2</h2>",

I get this warning:

[Vue warn]: Property "htmlTest2" was accessed during render but is not defined on instance.

Resulting into the error:

Uncaught (in promise) TypeError: template is undefined

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda