floating-vue
floating-vue copied to clipboard
How to configure when using components directly?
In the documentation is written:
Install the plugin into Vue:
[...]
Or use the directives and components directly:
I want to use the latter since I don't need all the features of floating-vue.
How can I configure a custom theme in this context. I tried:
import { Tooltip as VTooltip, options } from "floating-vue";
Object.assign(options, {
themes: {
"info-tooltip": {
$extend: "tooltip",
// Other options (see the 'Global options' section)
},
},
});
Sidenote:
I was a bit confused because the package exports tooltips as Tooltip while the example uses the name VTooltip.
There is a page about config here.
Basically you can do this to add a new theme:
options.themes['info-tooltip'] = { /* ... */ }
The example is based on the globally registered components. Maybe I should improve the "use directives/components directly" part.
Thanks! I will give it a try :)
I tested and it seems to work. Thank you, feel free to close!
The example is based on the globally registered components. Maybe I should improve the "use directives/components directly" part.
This would help a lot. I was really confused sometimes reading through the documentation.