antd-mini-rpx
Advanced tools
Comparing version 0.0.3-beta.8 to 0.0.3-beta.9
import { ComponentContext } from '../_util/context'; | ||
export var componentContext = new ComponentContext(); | ||
export var componentContextFallback = new ComponentContext(); | ||
export var getTabArray = {}; |
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { TabsDefaultProps } from './props'; | ||
import { getTabArray, componentContext } from './context'; | ||
import { getTabArray, componentContext, componentContextFallback } from './context'; | ||
import { log } from '../_util/console'; | ||
@@ -46,2 +46,3 @@ import { objectValues } from '../_util/tools'; | ||
}); | ||
componentContextFallback.update(this.props.fallback); | ||
var _this$props = this.props, | ||
@@ -100,4 +101,9 @@ index = _this$props.index, | ||
index = _this$props2.index, | ||
animation = _this$props2.animation; | ||
animation = _this$props2.animation, | ||
fallback = _this$props2.fallback; | ||
if (prevProps.fallback !== fallback) { | ||
componentContextFallback.update(fallback); | ||
} | ||
if (prevProps.index !== index && prevData.currentIndex === this.data.currentIndex) { | ||
@@ -104,0 +110,0 @@ this._getTabsWidth(); |
import { IBaseProps } from '../_base'; | ||
/** | ||
* @description 标签栏,内部配合 TabItem 使用。 | ||
*/ | ||
export interface ITabsProps extends IBaseProps { | ||
@@ -17,3 +17,2 @@ /** | ||
*/ | ||
index?: number; | ||
@@ -23,3 +22,2 @@ /** | ||
*/ | ||
onChange?: (index: number) => void; | ||
@@ -30,3 +28,2 @@ /** | ||
*/ | ||
animation?: boolean; | ||
@@ -38,3 +35,2 @@ /** | ||
swipeable?: boolean; | ||
/** | ||
@@ -45,3 +41,23 @@ * @description 是否支持吸顶 | ||
sticky?: boolean; | ||
/** | ||
* @description 吸顶高度 | ||
* @default 0 | ||
*/ | ||
stickyTop?: boolean; | ||
/** | ||
* @description 内部 swiper 组件的 onTouchStart 事件(仅在基础库 2.x 版本生效) | ||
* @default 0 | ||
*/ | ||
onTouchStart?: (e:any) => void; | ||
/** | ||
* @description 内部 swiper 组件的 onTouchStart 事件(仅在基础库 2.x 版本下生效) | ||
* @default 0 | ||
*/ | ||
onTransition?: (e:any) => void; | ||
/** | ||
* @description 是否自定义实现"轮播",详见 fallback demo | ||
* @default 0 | ||
*/ | ||
fallback?: boolean; | ||
} | ||
export declare const TabsDefaultProps: Partial<ITabsProps>; |
import { TabItemDefaultProps } from './props'; | ||
import { getTabArray, componentContext } from '../context'; | ||
import { getTabArray, componentContext, componentContextFallback } from '../context'; | ||
import { log } from '../../_util/console'; | ||
@@ -10,6 +10,15 @@ import { objectValues } from '../../_util/tools'; | ||
data: { | ||
component2: component2 | ||
component2: component2, | ||
fallback: false | ||
}, | ||
didMount: function didMount() { | ||
var _this = this; | ||
this._getTabInfo('didMount'); | ||
componentContextFallback.onUpdate(function (v) { | ||
_this.setData({ | ||
fallback: v | ||
}); | ||
}); | ||
}, | ||
@@ -16,0 +25,0 @@ didUpdate: function didUpdate() { |
{ | ||
"name": "antd-mini-rpx", | ||
"version": "0.0.3-beta.8", | ||
"version": "0.0.3-beta.9", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "minidev dev --less --typescript --no-source-map", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
319095
5962