Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rax-image

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-image - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3-1

2

dist/index-es6.js

@@ -1,1 +0,1 @@

!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var i=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};const c={},a=Object(n.forwardRef)((e,r)=>{var{source:t,fallbackSource:a,onLoad:l,onError:s,style:f,resizeMode:b}=e,p=i(e,["source","fallbackSource","onLoad","onError","style","resizeMode"]);t=t||c,a=a||c;const d=p,[y,O]=Object(n.useState)({});d.onError=Object(n.useCallback)(e=>{void 0===y.uri&&O({uri:t.uri}),s&&s(e)},[t.uri,s,y]),d.onLoad=Object(n.useCallback)(e=>{e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):s&&s(e)},[l,s]),void 0!==y.uri&&(y.uri!==t.uri?y.uri=void 0:null!=a.uri&&(t=a));const{width:v,height:g,uri:j}=t;return d.src=j,d.style=Object.assign({width:v,height:g},f),(b=b||d.style.resizeMode)&&(o.isWeex?(d.resize=b,d.style.resizeMode=b):d.style.objectFit=b),o.isWeex?Object(n.createElement)("image",u({quality:"original"},d,{ref:r})):Object(n.createElement)("img",u({},d,{ref:r}))});r.default=a}]);
!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function i(){return(i=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var u=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};const a={},c=Object(n.forwardRef)((e,r)=>{var{source:t,fallbackSource:c,onLoad:l,onError:s,style:f,resizeMode:p,lazyLoad:d}=e,y=u(e,["source","fallbackSource","onLoad","onError","style","resizeMode","lazyLoad"]);t=t||a,c=c||a;const b=y,[O,g]=Object(n.useState)({});b.onError=Object(n.useCallback)(e=>{void 0===O.uri&&g({uri:t.uri}),s&&s(e)},[t.uri,s,O]),b.onLoad=Object(n.useCallback)(e=>{e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):s&&s(e)},[l,s]),void 0!==O.uri&&(O.uri!==t.uri?O.uri=void 0:null!=c.uri&&(t=c));const{width:v,height:j,uri:h}=t;return b.src=h,b.style=Object.assign({width:v,height:j},f),(p=p||b.style.resizeMode)&&(o.isWeex?(b.resize=p,b.style.resizeMode=p):b.style.objectFit=p),(o.isMiniApp||o.isWeChatMiniProgram||o.isByteDanceMicroApp)&&(b["lazy-load"]=!!d),o.isWeb&&d&&(b.loading="lazy"),o.isWeex?Object(n.createElement)("image",i({quality:"original"},b,{ref:r})):Object(n.createElement)("img",i({},b,{ref:r}))});r.default=c}]);

@@ -1,1 +0,1 @@

!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var i=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},a={},c=Object(n.forwardRef)((function(e,r){var t=e.source,c=e.fallbackSource,l=e.onLoad,f=e.onError,s=e.style,b=e.resizeMode,p=i(e,["source","fallbackSource","onLoad","onError","style","resizeMode"]);t=t||a,c=c||a;var d=p,y=Object(n.useState)({}),O=y[0],v=y[1];d.onError=Object(n.useCallback)((function(e){void 0===O.uri&&v({uri:t.uri}),f&&f(e)}),[t.uri,f,O]),d.onLoad=Object(n.useCallback)((function(e){e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):f&&f(e)}),[l,f]),void 0!==O.uri&&(O.uri!==t.uri?O.uri=void 0:null!=c.uri&&(t=c));var g=t,j=g.width,h=g.height,m=g.uri;return d.src=m,d.style=Object.assign({width:j,height:h},s),(b=b||d.style.resizeMode)&&(o.isWeex?(d.resize=b,d.style.resizeMode=b):d.style.objectFit=b),o.isWeex?Object(n.createElement)("image",u({quality:"original"},d,{ref:r})):Object(n.createElement)("img",u({},d,{ref:r}))}));r.default=c}]);
!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function i(){return(i=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var u=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},a={},c=Object(n.forwardRef)((function(e,r){var t=e.source,c=e.fallbackSource,l=e.onLoad,s=e.onError,f=e.style,p=e.resizeMode,d=e.lazyLoad,y=u(e,["source","fallbackSource","onLoad","onError","style","resizeMode","lazyLoad"]);t=t||a,c=c||a;var b=y,O=Object(n.useState)({}),v=O[0],g=O[1];b.onError=Object(n.useCallback)((function(e){void 0===v.uri&&g({uri:t.uri}),s&&s(e)}),[t.uri,s,v]),b.onLoad=Object(n.useCallback)((function(e){e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):s&&s(e)}),[l,s]),void 0!==v.uri&&(v.uri!==t.uri?v.uri=void 0:null!=c.uri&&(t=c));var j=t,h=j.width,m=j.height,x=j.uri;return b.src=x,b.style=Object.assign({width:h,height:m},f),(p=p||b.style.resizeMode)&&(o.isWeex?(b.resize=p,b.style.resizeMode=p):b.style.objectFit=p),(o.isMiniApp||o.isWeChatMiniProgram||o.isByteDanceMicroApp)&&(b["lazy-load"]=!!d),o.isWeb&&d&&(b.loading="lazy"),o.isWeex?Object(n.createElement)("image",i({quality:"original"},b,{ref:r})):Object(n.createElement)("img",i({},b,{ref:r}))}));r.default=c}]);

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.raxImage=r():e.raxImage=r()}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var i=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},a={},c=Object(n.forwardRef)((function(e,r){var t=e.source,c=e.fallbackSource,l=e.onLoad,f=e.onError,s=e.style,p=e.resizeMode,d=i(e,["source","fallbackSource","onLoad","onError","style","resizeMode"]);t=t||a,c=c||a;var b=d,y=Object(n.useState)({}),O=y[0],j=y[1];b.onError=Object(n.useCallback)((function(e){void 0===O.uri&&j({uri:t.uri}),f&&f(e)}),[t.uri,f,O]),b.onLoad=Object(n.useCallback)((function(e){e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):f&&f(e)}),[l,f]),void 0!==O.uri&&(O.uri!==t.uri?O.uri=void 0:null!=c.uri&&(t=c));var v=t,g=v.width,x=v.height,m=v.uri;return b.src=m,b.style=Object.assign({width:g,height:x},s),(p=p||b.style.resizeMode)&&(o.isWeex?(b.resize=p,b.style.resizeMode=p):b.style.objectFit=p),o.isWeex?Object(n.createElement)("image",u({quality:"original"},b,{ref:r})):Object(n.createElement)("img",u({},b,{ref:r}))}));r.default=c}])}));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.raxImage=r():e.raxImage=r()}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="./",t(t.s=2)}([function(e,r){e.exports=require("rax")},function(e,r){e.exports=require("universal-env")},function(e,r,t){e.exports=t(3)},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t(1);function i(){return(i=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var u=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},a={},c=Object(n.forwardRef)((function(e,r){var t=e.source,c=e.fallbackSource,l=e.onLoad,f=e.onError,s=e.style,p=e.resizeMode,d=e.lazyLoad,y=u(e,["source","fallbackSource","onLoad","onError","style","resizeMode","lazyLoad"]);t=t||a,c=c||a;var b=y,O=Object(n.useState)({}),g=O[0],j=O[1];b.onError=Object(n.useCallback)((function(e){void 0===g.uri&&j({uri:t.uri}),f&&f(e)}),[t.uri,f,g]),b.onLoad=Object(n.useCallback)((function(e){e&&e.success||e&&e.currentTarget&&e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?l&&l(e):f&&f(e)}),[l,f]),void 0!==g.uri&&(g.uri!==t.uri?g.uri=void 0:null!=c.uri&&(t=c));var v=t,m=v.width,x=v.height,h=v.uri;return b.src=h,b.style=Object.assign({width:m,height:x},s),(p=p||b.style.resizeMode)&&(o.isWeex?(b.resize=p,b.style.resizeMode=p):b.style.objectFit=p),(o.isMiniApp||o.isWeChatMiniProgram||o.isByteDanceMicroApp)&&(b["lazy-load"]=!!d),o.isWeb&&d&&(b.loading="lazy"),o.isWeex?Object(n.createElement)("image",i({quality:"original"},b,{ref:r})):Object(n.createElement)("img",i({},b,{ref:r}))}));r.default=c}])}));

@@ -33,3 +33,4 @@ "use strict";

resizeMode = _a.resizeMode,
otherProps = __rest(_a, ["source", "fallbackSource", "onLoad", "onError", "style", "resizeMode"]);
lazyLoad = _a.lazyLoad,
otherProps = __rest(_a, ["source", "fallbackSource", "onLoad", "onError", "style", "resizeMode", "lazyLoad"]);

@@ -92,11 +93,26 @@ source = source || EMPTY_SOURCE;

}
} // For MiniApp runtime
if (_universalEnv.isMiniApp || _universalEnv.isWeChatMiniProgram || _universalEnv.isByteDanceMicroApp) {
nativeProps['lazy-load'] = !!lazyLoad;
} // For native lazyLoad support on Web
// see: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/img
if (_universalEnv.isWeb && lazyLoad) {
nativeProps['loading'] = 'lazy';
} // Set default quality to "original" in weex avoid image be optimized unexpect
return _universalEnv.isWeex ? (0, _rax.createElement)("image", _extends({
quality: "original"
}, nativeProps, {
if (_universalEnv.isWeex) {
return (0, _rax.createElement)("image", _extends({
quality: "original"
}, nativeProps, {
ref: ref
}));
}
return (0, _rax.createElement)("img", _extends({}, nativeProps, {
ref: ref
})) : (0, _rax.createElement)("img", _extends({}, nativeProps, {
ref: ref
}));

@@ -103,0 +119,0 @@ });

@@ -47,2 +47,7 @@ import { HTMLAttributes, RefAttributes, CSSProperties, SyntheticEvent } from 'rax';

/**
* lazyLoad: enable lazy-load
* support: Web/MiniApp
*/
lazyLoad?: boolean;
/**
* callback of success

@@ -49,0 +54,0 @@ */

{
"name": "rax-image",
"version": "2.2.2",
"version": "2.2.3-1",
"description": "Image component for Rax.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

@@ -31,2 +31,3 @@ # Image

| source | `object: {uri: string}` | - | true | 设置图片的 uri | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /><img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /><img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"><img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px"><img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> |
| lazyLoad | `boolean` | - | false | 是否开启懒加载(注:在Web上需要原生支持`loading="lazy"`) | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /><img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"><img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px"> |
| style | `object: { width: number height: number }` | - | true | 图片样式 width 和 height 为必填属性,否则图片无法正常展示,可以补充其他属性 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /><img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /><img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"><img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px"><img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> |

@@ -33,0 +34,0 @@ | fallbackSource | `object: {uri: string}` | - | false | 备用图片的 uri(当主图加载失败是加载) | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /><img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> |

@@ -54,2 +54,7 @@ import {

/**
* lazyLoad: enable lazy-load
* support: Web/MiniApp
*/
lazyLoad?: boolean;
/**
* callback of success

@@ -56,0 +61,0 @@ */

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc