百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

ng-lazyload-image

> 前端框架
开源

一个用于 Angular 应用程序的懒加载图像的小库,无任何依赖

751 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个用于 Angular 应用程序的懒加载图像的小库,无任何依赖

ng-lazyload-image 这是一个用于 Angular 应用程序的懒加载图像的超小型库,无任何依赖。

您要针对的浏览器需要支持 WeakMap 和 String.prototype.includes。如果需要支持旧版浏览器(如 IE),则需要包含 WeakMap 和 String.prototype.includes 的补丁(请参阅 https://github.com/zloirock/core-js 为例)。此外,如果需要针对 IE 并希望使用 IntersectionObserver,还需要包含 IntersectionObserver 的补丁。

javascript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LazyLoadImageModule } from 'ng-lazyload-image'; // ` elements.  
There's no need to set `useSrcset` for `` elements, as `srcset` is used by default.  
A simple example for a `` tag:

JavaScript @Component({ selector: 'image', 模板: ` ', }) class ImageComponent { screen_lg = '1200px'; screen_md = '992px'; defaultImage = 'https://www.placecage.com/1000/1000';' image1 = 'https://images.unsplash.com/photo-1422004707501-e8dad229e17a?fm=jpg'; image2 = 'https://images.unsplash.com/photo-1439931444800-9bcc83f804a6?fm=jpg'; image3 = 'https://images.unsplash.com/photo-1417128281290-30a42da46277?fm=jpg'; }

### 异步加载图像路径
您可以加载 im

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptangularlazy-loading

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架