maoberlehner / perfundo

a pure CSS lightbox (now with JavaScript).
https://perfundo.oberlehner.net
MIT License
185 stars 9 forks source link

Error: perfundo is not a function #120

Open marcfilleul opened 4 years ago

marcfilleul commented 4 years ago

Hi,

I'm trying perfundo in Nuxt but get an error: perfundo is not a function.

Here is my code:

<script>
const perfundo = require("perfundo");
import "../node_modules/perfundo/dist/perfundo.with-icons.min.css";
export default {
  mounted() {
    perfundo(".js-perfundo", {
      disableHistory: true,
      swipe: true,
      keyboard: true
    });
  }
};
</script>

Any idea about this error ?

maoberlehner commented 4 years ago

Unfortunately not. Can you create a CodeSandbox or something similar for easier reproduction? Then I can take a quick look at it.

marcfilleul commented 4 years ago

Hi,

I've started to create a CodeSandbox example but I have a require is not defined error which I can't solve.

The example is in the perfundo.vue file.