2
The browser page is empty and the following error appears in the console:
Failed to resolve directive: ref
After commenting and uncommenting various parts of my code, I discovered that the page only works right when I comment on this line:
<h3>{{ status }}</h3>
I am using Vue.js 2. This status is computed:
computed: {
status: function(){
var count = 0;
var lista = this.$refs.listaComponent;
for(var i in lista.contas){
if (!lista.contas[i].pago) {
count++;
}
}
return !count ? "Nenhuma conta a pagar." : "Existem " + count + " contas a pagar.";
}
},
My HTML has this line:
<lista-component v-ref:lista-component></lista-component>
I know what haha’s like, in the American OS I can’t comment either. It is right, because if I comment on that line that is in the component template it works right. So I came to the conclusion that the problem is in computed. And searching here seems that the problem has to do with v-ref. Maybe it’s because I’m adapting to routes?
– Guilherme Pressutto
I just noticed that the error has changed to:
Failed to resolve directive: ref
– Guilherme Pressutto