File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,42 @@ app.component('VTooltip', FloatingVue.Tooltip)
92
92
app .component (' VMenu' , FloatingVue .Menu )
93
93
```
94
94
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
+
95
131
## Vue 2
96
132
97
133
floating-vue v5 is compatible with Vue 3. For Vue 2, use floating-vue v1 instead:
You can’t perform that action at this time.
0 commit comments