Asked By: Anonymous
I want to get the value from methods and put this value in span element
There is my pseudo code and I don’t know what is the right way to do that. Maybe stored in data?
<li v-for="item in items">
<span>{{I want this value is from methods}} getValue(item)</span>
</li>
methods: {
getValue: function(value){
return "value form methods" + value
}
}
Solution
Answered By: Anonymous
Simple like that:
<li v-for="item in items">
<span>{{ getValue(item) }} </span>
</li>
methods: {
getValue: function(value){
return "value form methods" + value
}
}
Please do better with your questions quality.