Open
Description
Describe the bug
I loved your plugin, the problem is it doesn't work with Nuxt 3 .
To Reproduce
I tried the following, still adding the button or triggering via code doesn't show the modal.
- Loading inside setup
if (process.client) {
const { spotlight } = await import('https://cdn.jsdelivr.net/gh/cttricks/spotlight.js/dist/spotlight.min.js');
const Spotlight = await spotlight();
window.Spotlight = Spotlight;
}
- Loading from nuxt.config.ts
"script": [
{ src: "https://cdn.jsdelivr.net/gh/cttricks/spotlight.js/dist/spotlight.min.js", type: "module", "data-lights-on": "true" ,tagPosition:"bodyClose" },
]
- Loading as plugin
export default defineNuxtPlugin(() => {
if (process.client) {
const script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/gh/cttricks/spotlight.js/dist/spotlight.min.js';
script.type = 'module';
script.setAttribute('lights-on', '');
document.head.appendChild(script);
}
});
Expected behavior
Doing a Spotlight.start() or Button with type below should work
<button type="spotlight-button:start">Start Demo Tour</button>
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Metadata
Metadata
Assignees
Labels
No labels