0.2.3 • Published 3 years ago
auto-size-background v0.2.3
Auto Size Background
Auto Size Background can set background image auto fit screen
Example
Stretch the webpage to see the effect
Installation
npm i --save auto-size-background
Import the components you need, example:
import React from 'react'
import AutoSizeBackground from 'auto-size-background'
import img from 'img-link-here'
export default props => {
return (
<AutoSizeBackground src={img}>
{props.children}
</AutoSizeBackground>
)
}
API
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
src | 图片地址 | string | - |
dtl | 图片伸缩方向,现在支持垂直、水平 | vertical | horizontal | horizontal |
Run from local
$ npm install
$ npm start
LICENSE
MIT