hilongjw / vue-lazyload

A Vue.js plugin for lazyload your Image or Component in your application.
http://hilongjw.github.io/vue-lazyload/
MIT License
7.99k stars 865 forks source link

Fix lazy dir can't be registered when SSR #503

Open anc95 opened 1 year ago

anc95 commented 1 year ago

Hey, the error detail is in #502

I dive into the issue, it's because when we import vue-lazyload

import Lazyload from 'vue-lazyload'

console.log(Lazyload)

will get

{
  default: {
    install
  }
}

if follow the instruction in readme

App.use(Lazyload)

it can't be registered in Node env

So I modified the export from default export to named export to avoid this happen.

Please review, Thanks