I am using a v-for loop and using a Vue.directive for a bootstrap tooltip which sets the binding value a string which I return from a method. How do I change this binding value once I have new data? It does not update even when I have new data returned from my method.
I have tried making a data variable and setting this in my method and using the variable in my directive and it still didn't change.
Vue.directive('tooltip',
function(el, binding) {
$(el).tooltip({
title: binding.value,
placement: binding.arg,
trigger: 'hover'
});
});
<li v-for="(display_name, index) in displayNameList" class="nav-item">
<a v-tooltip:bottom="tabTooltipSet(index)" {{ display_name }}</a>
</li>
I expect the binding.value to change to whatever the function returns when called, which it does initially. But after that value has been set and my displayNameList can completely change it does not update accordingly. So if my first tab is set to DOG and then I change the list and set it to CAT the tooltip should be CAT instead of DOG.