How do I use AddEventListener () in vueJs?

0

I'm doing a function of my project and I need to use the addEventListener() event but it's giving an error:

excluirVariante:function(v){
    console.log(this.$el.querySelector('#op_nao'));
    console.log(this.$el.querySelector('#op_sim'));
    $('#model_permissao').modal('show');
    console.log(v);
    this.$el.querySelector("#op_sim").addEventListener("click",function(){
        this.lista_variante.find(function(el,i,list){
            if(el===v){
                list.splice(i,1);
                console.log('foi');
            }
        });
    },false);
    this.$el.querySelector('#op_nao').addEventListener('click',function(){
        $('#model_permissao').model('hide');
    },false);
},

This is the error:

  

app.js: 14719 Uncaught TypeError: Can not read property 'addEventListener' of null           at VueComponent.excludeVarious (app.js: 14719)           at Proxy.boundFn (app.js: 27396)           at click (app.js: 18030)           at HTMLElement.invoker (app.js: 28969)

    
asked by anonymous 25.05.2017 / 14:37

0 answers