2.3.12 • Published 5 years ago

nuke-biz-picture v2.3.12

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

Biz Picture

Complex image component fork from rax-picture & add i18n config.

Install

$ npm install nuke-biz-picture --save

Import

import Picture from 'nuke-biz-picture';

Props

nametypedefaultdescribe
srcstring''picture source(need)
styleobjectmust set style.width ,style.height ,(need)
resizeModestringstretchHow to adjust the size of the picture when the picture size is out of proportion
forceUpdatebooleanfalsePicture is a PureComponent ,It will render when porps.src has change (in shouldComponentUpdate), If you want to ignore shouldComponentUpdate,you need forceUpdate={true}
widthnumberpicture width (px)
heightnumberpicture height (px)
lazyloadbooleanfalse(for web)picture lazyload,useing://g.alicdn.com/kg/appear/0.2.2/appear.min.js
autoPixelRatiobooleantrue(for web)high resolution
placeholderstring(for web)background image for lazyload
autoRemoveSchemebooleantrue(for web) Automatic deletion protocol header

resizeMode value:

  • cover: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).
  • contain: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
  • stretch: Scale width and height independently, This may change the aspect ratio of the src.

(must set style.width && style.height)

Example

import {createElement, Component, render} from 'rax';
import ScrollView from 'nuke-scroll-view';
import Picture from 'nuke-biz-picture';

class Demo extends Component {
  render() {
    return <ScrollView ref='scroll'>
       <Picture
         src='//gw.alicdn.com/tfscom/tuitui/TB2jLF1lXXXXXc7XXXXXXXXXXXX_!!0-dgshop.jpg'
         style={{
           width: 375,
           height: 252
         }}
         lazyload={true}
         resizeMode="cover"
       />
    </ScrollView>;
  }
}
render(<Demo />);
2.3.12

5 years ago

2.3.11

5 years ago

2.3.10

5 years ago

2.3.8

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.0

5 years ago

2.2.29

6 years ago

2.2.28

6 years ago

2.2.26

6 years ago

2.2.24

6 years ago

2.2.23

6 years ago

2.2.21

6 years ago

2.2.19

6 years ago

2.2.18

6 years ago

2.2.17

6 years ago

2.2.16

6 years ago

2.2.14

6 years ago

2.2.13

6 years ago

2.2.11

6 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago