New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mini-antui

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-antui - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3-alpha.1

es/tabs/util.sjs

52

es/tabs/index.js

@@ -0,1 +1,4 @@

var _my$getSystemInfoSync = my.getSystemInfoSync(),
windowWidth = _my$getSystemInfoSync.windowWidth;
Component({

@@ -9,22 +12,18 @@ props: {

showPlus: false,
swipeable: true
swipeable: true,
activeTab: 0 // 当前激活tab
},
data: {
scrollInit: 0,
current: 0,
windowWidth: 0,
tabWidth: 0.25
windowWidth: windowWidth,
tabWidth: 0.25,
autoplay: false,
animation: false
},
didMount: function didMount() {
var _this = this;
var tabs = this.props.tabs;
my.getSystemInfo({
success: function success(res) {
_this.setData({
windowWidth: res.windowWidth,
tabWidth: tabs.length > 3 ? 0.25 : 1 / tabs.length
});
}
this.setData({
tabWidth: tabs.length > 3 ? 0.25 : 1 / tabs.length,
animation: true,
autoplay: true
});

@@ -38,9 +37,5 @@ },

this.moveScrollBar(current);
if (this.props.onChange) {
this.props.onChange({ index: current });
}
this.setData({
current: current
});
},

@@ -51,9 +46,5 @@ handleTabClick: function handleTabClick(e) {

this.moveScrollBar(index);
if (this.props.onTabClick) {
this.props.onTabClick({ index: index });
}
this.setData({
current: index
});
},

@@ -64,21 +55,4 @@ handlePlusClick: function handlePlusClick() {

}
},
moveScrollBar: function moveScrollBar(current) {
var _data = this.data,
windowWidth = _data.windowWidth,
tabWidth = _data.tabWidth;
var scrollInit = current * windowWidth * tabWidth;
if (current <= 2) {
scrollInit = 0;
} else {
scrollInit = (current - 2) * windowWidth * tabWidth;
}
this.setData({
scrollInit: scrollInit
});
}
}
});
{
"name": "mini-antui",
"version": "0.3.2",
"version": "0.3.3-alpha.1",
"description": "小程序版AntUI",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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