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

124
Vistas
How to set binded attribute to custom component in Vue

Hello I'm trying to add a custom Vue component to my template using the DOM, I already setted the properties, but I can't set the associated attribute of events in the custom component. Here is my buttonVue.vue component (child component) :

export default {
emits:['action','isAuth'],
data:function(){
    return {msg:this.textDisplay()}
},
 methods:{
    textDisplay(){
        return this.$emit('isAuth')?'Sign in with Microsoft':'Sign out from Microsoft'
    }
 }
}
</script>

parent component:

 insertBtnComponent){
    var ComponentClass = Vue.extend(buttonVue)
    var instance = new ComponentClass({
    propsData:{class:"buttonMs" ,style:" position: static ;",
    'action':this.isUserAuthenticated()?this.signOut():this.signInUser(),
    'isAuth':this.isUserAuthenticated()
   }
 })
  let selector = document.querySelector(".classNAMEofDiv");
  instance.$mount()
  selector.appendChild(instance.$el)

I would appreciate any hints on my problem, thanks in advance.

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