Search code examples
vue.jstooltipquasar

Load tooltip text dynamically


Is it possible to load the q-tooltip text dynamically?

What property to use?

In my example, what is the correct property to use instead of :value (this property does not exist in the q-tooltip and is for demonstration only)?

<q-item-section avatar>
     <q-icon :name="typeIcon(item.type_item)" />
     <q-tooltip :value="tooltipIcon(item.type_item)" transition-show="scale" transition-hide="scale" content-class="bg-primary"  />
</q-item-section>

Solution

  • You can just use your method inside of the q-tooltip tags to set text. I don't see any problem with that:

    <q-tooltip>
       {{ tooltipIcon(item.type_item) }}
    </q-tooltip>