{"id":13387937,"url":"https://github.com/wormsan/vue-lazyload-img","last_synced_at":"2025-03-13T13:32:07.206Z","repository":{"id":79465738,"uuid":"56170563","full_name":"wormsan/vue-lazyload-img","owner":"wormsan","description":"A plugin of vue for image lazyload（vue图片懒加载插件）","archived":false,"fork":false,"pushed_at":"2018-05-04T11:45:54.000Z","size":4833,"stargazers_count":249,"open_issues_count":3,"forks_count":52,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-29T10:45:17.530Z","etag":null,"topics":["image-lazyload","lazyload","vue","vue-lazyload"],"latest_commit_sha":null,"homepage":"http://docs.gomeminus.com/vue-lazyload-img/test/bundle.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wormsan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-04-13T17:02:53.000Z","updated_at":"2024-09-16T09:32:35.000Z","dependencies_parsed_at":"2024-01-02T23:37:43.504Z","dependency_job_id":"a32268f2-e1a7-49e8-af36-d0a89f2e20c2","html_url":"https://github.com/wormsan/vue-lazyload-img","commit_stats":null,"previous_names":["jalbaa/vue-lazyload-img"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormsan%2Fvue-lazyload-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormsan%2Fvue-lazyload-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormsan%2Fvue-lazyload-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormsan%2Fvue-lazyload-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wormsan","download_url":"https://codeload.github.com/wormsan/vue-lazyload-img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243414481,"owners_count":20287129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-lazyload","lazyload","vue","vue-lazyload"],"created_at":"2024-07-30T13:00:20.580Z","updated_at":"2025-03-13T13:32:06.736Z","avatar_url":"https://github.com/wormsan.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","UI组件","JavaScript"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"[中文文档看这里](./README.zh-CN.md)\r\n\r\n## Update v2.1.0\r\n\r\n* Add requestAnimationFrame polyfill.\r\n* Now img lazyload detects horizontal direction automatically\r\n* Imporve perfomence, since the scroll event liseners were as many as pictures * 2 before, there is only two liseners now. \r\n\r\n## Update v2.1.1\r\n\r\n* Add .npmignore to exclude .babelrc\r\n\r\n## Update in V2.1.2\r\n\r\n* Preload, let you set a range to preload images before an image enters the viewport.\r\n* Rewrite with Typescript, add d.ts, make developing easier.\r\n\r\n## Update in V2.1.3\r\n\r\n* fix wrong export of typings\r\n\r\n## Next\r\n\r\n* Support partial-match image URLs, eg. `pic.400px.jpg` or `pic.200px.jpg`, let you switch resolution of images by some custom rules.\r\n* Maybe SSR.\r\n\r\n# English doc\r\n\r\n# Finally Available on vue2, if you use v1, use `npm install vue-lazyload-img@1`\r\n\r\n# vue-lazyload-img\r\n\r\n## intro\r\n    a plugin of vue for image lazyload, especially optimized for mobile browser\r\n## demo\r\n\r\nUse mobile mode if possible\r\n\r\n[var with script tag](http://docs.gomeminus.com/vue-lazyload-img/test/var.html)\r\n\r\n[bundle with webpack](http://docs.gomeminus.com/vue-lazyload-img/test/bundle.html)\r\n\r\n## API\r\n\r\n### init\r\n\r\nVue.use(Lazyload[,options])\r\n\r\n### options\r\nglobal options\r\n#### fade: all images will use fadein fx\r\n\r\n* true: all images will fadein if lazyload Complete\r\n* false **(default)**: no fadein fx of all\r\n\r\n#### speed: threshold of loading lazyload iamge\r\n\r\n* 0 : load lazy-image when the image is visible at the 1st time\r\n* \u003e0 **(defult 0)**: average changes of document y-pos and any scroller's x-pos from last 10 frames\r\n\r\n#### time: duration of fade in or fade out\r\n\r\n* 300 **(default, unit: ms)**\r\n\r\n\r\n#### preload: set a range(vertical) to preload images before an image enters the viewport.\r\n\r\n* 0 **(default, unit: px)**\r\n\r\n```\r\nVue.use(Lazyload,{\r\n    // default false, recommand true\r\n    fade: true,\r\n    // it's better not set the speed now (because cellphones perfomance is better)\r\n    // this option make images show slower\r\n    // but if you open it, it does save network traffic data\r\n    // speed: 20,\r\n    // default 300, mostly, it's not necessary to set it\r\n    time: 300,\r\n    // unit:px, default 0, it allows the lazyload manager loads images(vertical) before an image appeard in screen\r\n    preload: 500,\r\n})\r\n```\r\n\r\n### directive\r\n\r\n#### v-lazyload\r\n\r\n* v-lazyload=\"src\"\r\n\r\n## How to import?\r\n\r\n### In CommonJs\r\n\r\n#### 1st\r\n``` shell\r\nnpm install vue-lazyload-img\r\n```\r\n\r\n#### 2nd\r\n\r\nes6\r\n```\r\nimport Lazyload from \"vue-lazyload-img\"\r\nVue.use(Lazyload)\r\n```\r\nes5\r\n\r\n```\r\nvar Lazyload = require(\"vue-lazyload-img\")\r\nVue.use(Lazyload)\r\n```\r\n\r\n\r\n**in this way, you'll need `babel` or something like it**\r\n\r\n### In browser\r\n\r\nbecause this plugins supports `umd`, so you can use it as a `\u003cscript\u003e` or with JS module loader like `require.js`.\r\n\r\nthe released bundle is in:\r\n\r\n`dist/vue.lazyimg.min.js`\r\n`dist/vue.lazyimg.js`\r\n\r\n\r\n\r\n[中文文档看这里](./README.zh-CN.md)\r\n\r\n## Update v2.1.0\r\n\r\n* Add requestAnimationFrame polyfill.\r\n* Now img lazyload detects horizontal direction automatically\r\n* Imporve perfomence, since the scroll event liseners were as many as pictures * 2 before, there is only two liseners now. \r\n\r\n## Update v2.1.1\r\n\r\n* Add .npmignore to exclude .babelrc\r\n\r\n## Update in V2.1.2\r\n\r\n* Preload, let you set a range to preload images before an image enters the viewport.\r\n* Rewrite with Typescript, add d.ts, make developing easier.\r\n\r\n## Next\r\n\r\n* Support partial-match image URLs, eg. `pic.400px.jpg` or `pic.200px.jpg`, let you switch resolution of images by some custom rules.\r\n* Maybe SSR.\r\n\r\n# English doc\r\n\r\n# Finally Available on vue2, if you use v1, use `npm install vue-lazyload-img@1`\r\n\r\n# vue-lazyload-img\r\n\r\n## intro\r\n    a plugin of vue for image lazyload, especially optimized for mobile browser\r\n## demo\r\n\r\nUse mobile mode if possible\r\n\r\n[var with script tag](http://docs.gomeminus.com/vue-lazyload-img/test/var.html)\r\n\r\n[bundle with webpack](http://docs.gomeminus.com/vue-lazyload-img/test/bundle.html)\r\n\r\n## API\r\n\r\n### init\r\n\r\nVue.use(Lazyload[,options])\r\n\r\n### options\r\nglobal options\r\n#### fade: all images will use fadein fx\r\n\r\n* true: all images will fadein if lazyload Complete\r\n* false **(default)**: no fadein fx of all\r\n\r\n#### speed: threshold of loading lazyload iamge\r\n\r\n* 0 : load lazy-image when the image is visible at the 1st time\r\n* bigger than 0 **(defult 0)**: average changes of document y-pos and any scroller's x-pos from last 10 frames\r\n\r\n#### time: duration of fade in or fade out\r\n\r\n* 300 **(default, unit: ms)**\r\n\r\n\r\n#### preload: set a range(vertical) to preload images before an image enters the viewport.\r\n\r\n* 0 **(default, unit: px)**\r\n\r\n```\r\nVue.use(Lazyload,{\r\n    // default false, recommand true\r\n    fade: true,\r\n    // it's better not set the speed now (because cellphones perfomance is better)\r\n    // this option make images show slower\r\n    // but if you open it, it does save network traffic data\r\n    // speed: 20,\r\n    // default 300, mostly, it's not necessary to set it\r\n    time: 300,\r\n    // unit:px, default 0, it allows the lazyload manager loads images(vertical) before an image appeard in screen\r\n    preload: 500,\r\n})\r\n```\r\n\r\n### directive\r\n\r\n#### v-lazyload\r\n\r\n* v-lazyload=\"src\"\r\n\r\n## How to import?\r\n\r\n### In CommonJs\r\n\r\n#### 1st\r\n``` shell\r\nnpm install vue-lazyload-img\r\n```\r\n\r\n#### 2nd\r\n\r\nes6\r\n```\r\nimport Lazyload from \"vue-lazyload-img\"\r\nVue.use(Lazyload)\r\n```\r\nes5\r\n\r\n```\r\nvar Lazyload = require(\"vue-lazyload-img\")\r\nVue.use(Lazyload)\r\n```\r\n\r\n\r\n**in this way, you'll need `babel` or something like it**\r\n\r\n### In browser\r\n\r\nbecause this plugins supports `umd`, so you can use it as a `\u003cscript\u003e` or with JS module loader like `require.js`.\r\n\r\nthe released bundle is in:\r\n\r\n`dist/vue.lazyimg.min.js`\r\n`dist/vue.lazyimg.js`\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormsan%2Fvue-lazyload-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwormsan%2Fvue-lazyload-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormsan%2Fvue-lazyload-img/lists"}