File tree Expand file tree Collapse file tree 3 files changed +382
-26
lines changed
Expand file tree Collapse file tree 3 files changed +382
-26
lines changed Original file line number Diff line number Diff line change 1- export default function ( ) {
2- const nuxt = this . nuxt
3- nuxt . options . vue . compilerOptions . directiveTransforms = nuxt . options . vue . compilerOptions . directiveTransforms || { }
4- nuxt . options . vue . compilerOptions . directiveTransforms . tooltip = ( ) => ( {
5- props : [ ] ,
6- needRuntime : true ,
7- } )
1+ export default async function ( _ , _nuxt ) {
2+ const { addPluginTemplate } = await import ( '@nuxt/kit' )
3+
4+ const nuxt = this . nuxt || _nuxt
85
96 nuxt . options . css . push ( 'floating-vue/dist/style.css' )
107
11- this . addPlugin ( {
8+ addPluginTemplate ( {
129 filename : 'floating-vue.mjs' ,
1310 getContents : ( ) => `
1411 import { defineNuxtPlugin } from '#app'
@@ -23,4 +20,11 @@ export default function () {
2320
2421 // @TODO remove when floating-ui supports native ESM
2522 nuxt . options . build . transpile . push ( 'floating-vue' , '@floating-ui/core' , '@floating-ui/dom' )
23+
24+ // SSR support for v-tooltip directive
25+ nuxt . options . vue . compilerOptions . directiveTransforms = nuxt . options . vue . compilerOptions . directiveTransforms || { }
26+ nuxt . options . vue . compilerOptions . directiveTransforms . tooltip = ( ) => ( {
27+ props : [ ] ,
28+ needRuntime : true ,
29+ } )
2630}
Original file line number Diff line number Diff line change 3232 "vue-resize" : " ^2.0.0-alpha.1"
3333 },
3434 "peerDependencies" : {
35- "vue" : " ^3.2.0"
35+ "vue" : " ^3.2.0" ,
36+ "@nuxt/kit" : " ^3.2.0"
37+ },
38+ "peerDependenciesMeta" : {
39+ "@nuxt/kit" : {
40+ "optional" : true
41+ }
3642 },
3743 "devDependencies" : {
3844 "@babel/core" : " ^7.22.5" ,
3945 "@babel/preset-env" : " ^7.22.5" ,
46+ "@nuxt/kit" : " ^3.6.1" ,
4047 "@peeky/test" : " ^0.14.1" ,
4148 "@vitejs/plugin-vue" : " ^4.2.3" ,
4249 "@vue/test-utils" : " ^1.3.6" ,
You can’t perform that action at this time.
0 commit comments