I simply just want to show the span if the name is found in the data. If its not found in the data, I want the span to hide. I am using simply v-if or v-else.It is currently displaying "my name is in the data". But it is not. I basically will have some names...and want the "my name is in the data" to only display if the name is indeed there.
new Vue({
el: "#app",
data: {
FirstName:'Paul',
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<span v-if="FirstName=='lu'||'John'||'Sue'">
My Name is in the data
</span><br>
<span v-else>
Not available
</span>
</div>