floating-vue icon indicating copy to clipboard operation
floating-vue copied to clipboard

How to configure when using components directly?

Open dpschen opened this issue 3 years ago • 3 comments

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.

dpschen avatar Apr 11 '22 16:04 dpschen

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.

Akryum avatar Apr 11 '22 19:04 Akryum

Thanks! I will give it a try :)

dpschen avatar Apr 11 '22 19:04 dpschen

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.

dpschen avatar Apr 12 '22 07:04 dpschen