2

I have wirte a line code usse v-b-tooltip of Bootstrap Vue. However I only want to have tooltip in some condition. How can I set condition to have tooltip or not.

<b-btn v-b-tooltip="'Tooltip'">

2 Answers 2

2

One possible way to disable tooltip is to have a "b-tooltip" element. Something like this:

<b-btn id="my-button">OK</b-btn>
<b-tooltip :disabled.sync="disableTooltip" target="my-button">Tooltip</b-tooltip>

<b-btn @click="disableTooltip = !disableTooltip">Enable / Disable Tooltip</b-btn>

Make sure you have the "disableTooltip" property in your data object.

More information:

https://bootstrap-vue.js.org/docs/components/tooltip/#programmatically-disabling-tooltip

Sign up to request clarification or add additional context in comments.

Comments

1

Disabling and enabling tooltips via $root events You can disable all open tooltips by emitting the bv::disable::tooltip event on $root:

this.$root.$emit('bv::disable::tooltip');

To disable a specific tooltip, pass the trigger element's id as the first argument:

this.$root.$emit('bv::disable::tooltip', 'my-trigger-button-id');

Here the Doc with more examples

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.