提交
This commit is contained in:
1
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.acss
generated
vendored
Normal file
1
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.acss
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.ant-tab-bar-wrap{display:flex;align-items:center;background-color:#fff}.ant-tab-bar-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 0;color:#666}.ant-tab-bar-item-active{color:#1677ff}.ant-tab-bar-icon{max-width:24px;max-height:24px;font-size:24px}.ant-tab-bar-image{font-size:24px;max-width:24px;max-height:24px}.ant-tab-bar-text{font-size:10px}
|
66
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.axml
generated
vendored
Normal file
66
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.axml
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<view
|
||||
class="ant-tab-bar {{className || ''}}"
|
||||
style="{{style || ''}}"
|
||||
>
|
||||
<view class="ant-tab-bar-wrap">
|
||||
<block
|
||||
a:for="{{items}}"
|
||||
a:for-index="index"
|
||||
a:for-item="item"
|
||||
>
|
||||
<view
|
||||
class="ant-tab-bar-item {{index === mixin.value ? 'ant-tab-bar-item-active ' + (activeClassName || '') : ''}}"
|
||||
style="{{index === mixin.value ? activeStyle || '' : ''}}"
|
||||
onTap="onChange"
|
||||
data-index="{{index}}"
|
||||
>
|
||||
<ant-badge
|
||||
a:if="{{item.badge}}"
|
||||
type="{{item.badge.type || 'dot'}}"
|
||||
text="{{item.badge.text}}"
|
||||
stroke="{{item.badge.stroke}}"
|
||||
bgColor="{{item.badge.bgColor}}"
|
||||
position="{{item.badge.position || 'top-right'}}"
|
||||
offsetX="{{item.badge.offsetX || '-9px'}}"
|
||||
offsetY="{{item.badge.offsetY || '0px'}}"
|
||||
>
|
||||
<slot
|
||||
name="icon"
|
||||
active="{{mixin.value == index}}"
|
||||
item="{{item}}"
|
||||
index="{{index}}"
|
||||
>
|
||||
<image-icon
|
||||
className="ant-tab-bar"
|
||||
image="{{mixin.value === index ? item.activeIcon : item.icon}}"
|
||||
></image-icon>
|
||||
</slot>
|
||||
</ant-badge>
|
||||
<block a:else>
|
||||
<slot
|
||||
name="icon"
|
||||
active="{{mixin.value == index}}"
|
||||
item="{{item}}"
|
||||
index="{{index}}"
|
||||
>
|
||||
<image-icon
|
||||
className="ant-tab-bar"
|
||||
image="{{mixin.value === index ? item.activeIcon : item.icon}}"
|
||||
></image-icon>
|
||||
</slot>
|
||||
</block>
|
||||
<view class="ant-tab-bar-text-wrap">
|
||||
<slot
|
||||
name="text"
|
||||
active="{{mixin.value === index}}"
|
||||
item="{{item}}"
|
||||
index="{{index}}"
|
||||
>
|
||||
<!--display: inline-->
|
||||
<text class="ant-tab-bar-text">{{item.text}}</text>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
1
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.d.ts
generated
vendored
Normal file
1
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
20
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.js
generated
vendored
Normal file
20
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { TabBarDefaultProps } from './props';
|
||||
import { Component, triggerEvent } from '../_util/simply';
|
||||
import mixinValue from '../mixins/value';
|
||||
Component(TabBarDefaultProps, {
|
||||
onChange: function (e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
if (index === this.getValue()) {
|
||||
return;
|
||||
}
|
||||
if (!this.isControlled()) {
|
||||
this.update(index);
|
||||
}
|
||||
triggerEvent(this, 'change', index, e);
|
||||
},
|
||||
}, null, [
|
||||
mixinValue({
|
||||
valueKey: 'current',
|
||||
defaultValueKey: 'defaultCurrent',
|
||||
}),
|
||||
]);
|
7
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.json
generated
vendored
Normal file
7
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/index.json
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"ant-badge": "../Badge/index",
|
||||
"image-icon": "../ImageIcon/index"
|
||||
}
|
||||
}
|
55
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/props.d.ts
generated
vendored
Normal file
55
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/props.d.ts
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
import { IBaseProps } from '../_util/base';
|
||||
import { IBadgeProps } from '../Badge/props';
|
||||
export interface ITabItem {
|
||||
/**
|
||||
* @description 底部图标,支持 Icon 或图片
|
||||
* @default ''
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* @description 高亮状态的底部图标,支持 Icon 或图片
|
||||
* @default ''
|
||||
*/
|
||||
activeIcon?: string;
|
||||
/**
|
||||
* @description 底部的文本信息
|
||||
* @default ''
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* @description 徽标,参见 <Badge/> 组件
|
||||
* @default undefined
|
||||
*/
|
||||
badge?: IBadgeProps;
|
||||
}
|
||||
/**
|
||||
* @description 标签栏,内部配合 TabItem 使用。
|
||||
*/
|
||||
export interface ITabBarProps extends IBaseProps {
|
||||
/**
|
||||
* @description tabbar 配置,为一个数组
|
||||
* @default []
|
||||
*/
|
||||
items: ITabItem[];
|
||||
/**
|
||||
* @description 选中
|
||||
*/
|
||||
current: number;
|
||||
/**
|
||||
* @description 初始值
|
||||
*/
|
||||
defaultCurrent: number;
|
||||
/**
|
||||
* @description 高亮状态图标和文本的 className
|
||||
*/
|
||||
activeClassName?: string;
|
||||
/**
|
||||
* @description 高亮状态图标和文本的 style
|
||||
*/
|
||||
activeStyle?: string;
|
||||
/**
|
||||
* @description tabbar 切换时的回调
|
||||
*/
|
||||
onChange: (index: number, e: Record<string, any>) => void;
|
||||
}
|
||||
export declare const TabBarDefaultProps: Partial<ITabBarProps>;
|
7
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/props.js
generated
vendored
Normal file
7
甲情_甲意/miniprogram/node_modules/antd-mini/es/TabBar/props.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export var TabBarDefaultProps = {
|
||||
items: [],
|
||||
current: null,
|
||||
defaultCurrent: 0,
|
||||
activeClassName: '',
|
||||
activeStyle: '',
|
||||
};
|
Reference in New Issue
Block a user