Skip to content

Commit fa626ac

Browse files
committed
docs: import directly
1 parent f4abcba commit fa626ac

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/guide/installation.md

+36
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,42 @@ app.component('VTooltip', FloatingVue.Tooltip)
9292
app.component('VMenu', FloatingVue.Menu)
9393
```
9494

95+
## Import directly
96+
97+
If you don't want to install the plugin into your Vue app globally, you can import the directives and components directly:
98+
99+
```vue
100+
<script setup>
101+
import { Dropdown, Tooltip, Menu, vTooltip } from 'floating-vue'
102+
</script>
103+
104+
<template>
105+
<Dropdown>
106+
<button>Click me</button>
107+
</Dropdown>
108+
109+
<Tooltip>
110+
<a>Sponsor me</a>
111+
</Tooltip>
112+
113+
<Menu>
114+
<button>Documentation</button>
115+
</Menu>
116+
117+
<button v-tooltip="msg">Hover me</button>
118+
</template>
119+
```
120+
121+
You can change the configuration too:
122+
123+
```js
124+
import { options } from 'floating-vue'
125+
126+
options.themes.myTheme = {
127+
// ...
128+
}
129+
```
130+
95131
## Vue 2
96132

97133
floating-vue v5 is compatible with Vue 3. For Vue 2, use floating-vue v1 instead:

0 commit comments

Comments
 (0)