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

nuke-image

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-image

图片

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-61.54%
Maintainers
1
Weekly downloads
 
Created
Source

Image

API

属性配置说明类型默认值
[即将废弃]source格式 {uri:"xxx"}object
srcurl stringstring
style如果 autoFit 为 false,则必须写宽高,否则无法渲染object
resizeMode组件尺寸和图片尺寸不成比例的时候如何调整图片的大小枚举类型,可选center contain cover stretchstretch
onLoad图片onLoad方法,其中e.size 可返回图片真实宽高function(e)
autoFit是否自适应,如果为true,会自动获取 onLoad 后得到的宽高,并设置到样式中booleanfalse
  • resizeMode 释义
    • contain : 包含,在区域内图片完全展示,不拉伸,不裁剪
    • cover : 覆盖,覆盖整个区域,可能图片本身会被部分被挡住而不显示,等比缩放,可能会裁剪
    • stretch : 拉伸,拉伸图片以撑满整个区域
    • center : 图片可能会被缩小以完全展示,但如果图片过小不会放大
    • repeat: 在区域内重复

例:


    <Image autoFit={true} src ="https://gd2.alicdn.com/imgextra/i2/413996455/TB2tNcJbd0opuFjSZFxXXaDNVXa_!!413996455.jpg" style={{quality:"original"}}/>

Keywords

FAQs

Package last updated on 17 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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