-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,65 @@ | ||
# react-fade-image | ||
> Fade or lazy image for react | ||
|
||
## properties: | ||
```javascript | ||
AUTO_PROPERTIES | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
onChange: PropTypes.func, | ||
value: PropTypes.bool | ||
}; | ||
|
||
static defaultProps = { | ||
onChange: noop, | ||
value: false | ||
}; | ||
|
||
``` | ||
|
||
## install && import: | ||
```bash | ||
npm install --save afeiship/react-fade-image --registry=https://registry.npm.taobao.org | ||
``` | ||
|
||
```js | ||
import ReactFadeImage from 'react-fade-image'; | ||
``` | ||
|
||
```scss | ||
// customize your styles: | ||
$react-fade-image-options:( | ||
); | ||
|
||
@import 'node_modules/react-fade-image/dist/style.scss'; | ||
``` | ||
|
||
|
||
## usage: | ||
```jsx | ||
AUTO_USAGE | ||
|
||
// install: npm install afeiship/react-fade-image --save | ||
// import : import ReactFadeImage from 'react-fade-image' | ||
|
||
class App extends React.Component{ | ||
state = { | ||
|
||
}; | ||
|
||
constructor(props){ | ||
super(props); | ||
window.demo = this; | ||
window.refs = this.refs; | ||
window.rc = this.refs.rc; | ||
} | ||
|
||
render(){ | ||
return ( | ||
<div className="hello-react-fade-image"> | ||
<ReactFadeImage value={false} src="http://imglf4.nosdn.127.net/img/KzNuMlRKSFVENitYYjJBYnU5Q2cwQjRjd0ljSURUWmxZeGxvWVlOYnhHZWRReFBoUVJWUXFRPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg" ref='rc' /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
``` |