I have a few Bootstrap Vue Tooltips and i'd like to reduce the footprint in markup by having a v-for that look through an object array and fills the values of the <b-tooltip> properties.
one of my current tooltips
<b-tooltip v-if="clientInContext && taxId && hideTaxId"
target="titlebar-taxId-eye-show"
:disabled.sync="disableTaxIdButtonTooltip"
:show.sync="showTaxIdButtonTooltip"
triggers="hover"
placement="bottom">
Click to temporarily display this value
</b-tooltip>
My V-For attempt:
<b-tooltip v-for='tooltip in tooltipContents'
v-if="tooltip.vif"
target="tooltip.target"
:disabled.sync="tooltip.disable"
:show.sync="tooltip.show"
triggers="hover"
placement="bottom">
{{tooltip.text}}
</b-tooltip>
public tooltipContents: object[] = [
{
vif: 'clientInContext && ssn && hideSsn',
target: 'titlebar-ssn-eye-show',
disable: this.disableSsnButtonTooltip,
show: this.showSsnButtonTooltip,
text: 'Click to temporarily display this value'
},
{
vif: 'clientInContext && ssn && !hideSsn',
target: 'titlebar-ssn-eye-hide',
disable: this.disableSsnButtonTooltip,
show: this.showSsnButtonTooltip,
text: 'Click to mask this value'
},
{
vif: 'clientInContext && ssn && !hideSsn',
target: 'titlebar-ssn',
disable: this.disableSsnTextTooltip,
show: this.showSsnTextTooltip,
text: '{{ssn}}'
}
]
I'm not sure what else I can do to get this to work. And haven't found anything online related to this issue.
vifproperty shouldn't be a string, but a statement, e.g.vif: clientInContext && ssn && !hideSsn(without the quotes), as you want it to be evaluated. The same for thetext: '{{ssn}}'should simply betext: ssn