Go back, modify the DOM after it renders

0

Help with those components, when I try to add a new element

  • when adding predefined text, it does it correctly, but when you listen to an external event to bring text, the text is picked up but it is never shown in:
    Vue.component('list-din',{
      template:'<div>
      <b-button v-on:click="agrega">Agregar</b-button>
        <b-list-group >
          <b-list-group-item v-for="(renglon, index) in this.renglones" v-bind:key="renglon.id"
          v-bind:title="renglon.opcion"
          v-on:remove="renglones.splice(index,1)" class="d-flex justify-content-between align-items-center"><tinymce-estatico>{{renglon.opcion}}</tinymce-estatico>
          <b-badge variant="primary" pill>{{renglon.calificacion}}</b-badge>
          </b-list-group-item>
        </b-list-group>
      </div>
      ',
      data() {
        return{ renglones: [{calificacion:1,
          opcion: 'texto',
          id: this.nextID,
          }
    
        ],
        nextID : 0,
      };
      },
      methods:{
        llama(){
          Event.fire('trae-opcion');},
        agrega(opcion){
          this.renglones.push({calificacion:1,opcion: opcion,id:this.nextID});
          this.nextID+=1;
        }
      },
      created:function(){
        Event.listen('recive-opcion',function(opcion){
          this.agrega(opcion);
          console.log('chido');      
        });
      } ,
    });
    
        
  • asked by chubbyRick 19.04.2018 в 19:56
    source

    0 answers