how can I call a function in an if in vue js

0

I want to call a counting function within an if of vue I would like to know how I can do it since I want it to go away accumulating every time the condition is fulfilled and everything I'm working with vue

var noticias new vuew(
  { el: '#app', 
    data { contador: 1}, 
    methods: { sumarUno: function(){ 
                       this.contador++  
                   }  
             }  
});

UPDATE

<div v-if="contador===0"> <div class="carousel-item active" > <img 
class="d-block w-100" src="<?= base_url() ?>{{f.Foto}}" alt="First 
slide"/> </div> <div v-else"> <div class="carousel-item" > <img class="d- 
block w-100" src="<?= base_url() ?>{{f.Foto}}" alt="First slide"/> </div> 
    
asked by Cristian Villalba 19.11.2018 в 23:06
source

0 answers