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

rax-image

Package Overview
Dependencies
Maintainers
7
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 1.0.0-miniapp.beta.7 to 1.0.0-miniapp.beta.8

60

lib/miniapp/index.js

@@ -17,30 +17,9 @@ import fmtEvent from '../_util/fmtEvent';

},
onInit() {
this.initImage();
},
didMount: function didMount() {
var mode = 'aspectFit';
const { width, height } = this.props.source || {};
let style = this.props.style || '';
if (width) style += 'width:' + width + 'rpx;';
if (height) style += 'height:' + height + 'rpx;';
switch (this.props.resizeMode) {
case 'cover':
mode = 'aspectFill';
break;
case 'contain':
mode = 'aspectFit';
break;
case 'stretch':
mode = 'scaleToFill';
break;
default:
mode = 'aspectFit';
if(!my.canIUse('component2')) {
this.initImage();
}
this.setData({
mode: mode,
style: style
});
},

@@ -51,4 +30,33 @@ methods: {

this.props.onClick(event);
},
initImage: function initImage(e) {
var mode = 'aspectFit';
const { width, height } = this.props.source || {};
let style = this.props.style || '';
if (width) style += 'width:' + width + 'rpx;';
if (height) style += 'height:' + height + 'rpx;';
switch (this.props.resizeMode) {
case 'cover':
mode = 'aspectFill';
break;
case 'contain':
mode = 'aspectFit';
break;
case 'stretch':
mode = 'scaleToFill';
break;
default:
mode = 'aspectFit';
}
this.setData({
mode: mode,
style: style
});
}
}
});
{
"name": "rax-image",
"version": "1.0.0-miniapp.beta.7",
"version": "1.0.0-miniapp.beta.8",
"description": "Image component for Rax.",

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

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