Here is my code:
JavaScript
let Names = [
{
Name: "Josh"
FullName: ""
},
{
Name: "Jonathan"
FullName: null
},
{
Name: "James"
FullName: "James Johnson"
}
];
Index.Vue
<ul>
<li
v-for="item in Names"
v-if=" item.FullName != null || item.FullName != '' "
>
{{FullName}}
</li>
</ul>
This v-if=" item.FullName != null || item.FullName != '' " does not work, Why? How can I put two condition inside a v-if?
v-forso you couldn't really use a computed, but you could use a method.liifFullNameis''(empty string) ornull. Just that =xv-if="!!item.FullName"!!double negates and returns an actual boolean value representing if they are any of those falsy values or not.