[Solved] Vue2.x vue-lazyload Error: Failed to resolve directive: lazy

Today, I want to realize the lazy loading of pictures. After registering components according to the tutorial, the console will report an error as above

The version in package.json is found to be the default downloaded version 3.0.0-rc.2

Solution:

Try to modify the version to 1.3.3

"dependencies": {
    "axios": "^0.27.2",
    "core-js": "^3.8.3",
    "element-ui": "^2.15.9",
    "vue-lazyload": "^1.3.3",
    "vue": "^2.6.14",
    "vue-router": "^3.1.3"
  },

Run, no more errors!

Read More: