Skip to content

Commit ec79d8a

Browse files
committed
API
- Animation 组件 - - 新增 onAnimationStart、onAnimationEnd 事件 - Tabs 组件 - - 新增 tabs 属性下的 id 属性 - - 新增 touchMove 可滑动属性 - VerticalTab 组件 - - 新增 backTop 属性 BUG - Card 组件 - - 修复插入 children 内容时的异常提醒(不影响使用)
1 parent 244f8c8 commit ec79d8a

File tree

15 files changed

+1993
-1843
lines changed

15 files changed

+1993
-1843
lines changed

.idea/workspace.xml

+228-221
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/animation.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export interface IProps {
55
reverse?: boolean;
66
children?: any;
77
delay?: number;
8+
onAnimationStart?: (e: any) => void;
9+
onAnimationEnd?: (e: any) => void;
810
}
911

1012
declare const ClAnimation: ComponentClass<IProps>;

@types/card.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface IProps {
2020
* 默认 `white`
2121
*/
2222
bgColor?: bgColorMoreType | bgColorType | lightBgColorType;
23+
children?: any;
2324
}
2425

2526
declare const Card: ComponentClass<IProps>;

@types/index.d.ts

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
export { default as ClAvatar } from './avatar';
2-
export { default as ClButton } from './button';
3-
export { default as ClCheckbox } from './checkbox';
4-
export { default as ClDrawer } from './drawer';
5-
export { default as ClIcon } from './icon';
6-
export { default as ClInput } from './input';
7-
export { default as ClLayout } from './layout';
8-
export { default as ClLoading } from './loading';
9-
export { default as ClMenuList } from './menuList';
10-
export { default as ClModal } from './modal';
11-
export { default as ClNavBar } from './navBar';
12-
export { default as ClProgress } from './progress';
13-
export { default as ClRadio } from './radio';
14-
export { default as ClSearchBar } from './searchBar';
15-
export { default as ClSelect } from './select';
16-
export { default as ClShopBar } from './shopBar';
17-
export { default as ClStep } from './steps';
18-
export { default as ClSwiper } from './swiper';
19-
export { default as ClSwitch } from './switch';
20-
export { default as ClTabBar } from './tabBar';
21-
export { default as ClTabs } from './tabs';
22-
export { default as ClTag } from './tag';
23-
export { default as ClText } from './text';
24-
export { default as ClTimeline } from './timeline';
25-
export { default as ClTitleBar } from './titleBar';
26-
export { default as ClImagePicker } from './imagePicker';
27-
export { default as ClCard } from './card';
28-
export { default as ClScreenDrawer } from './screenDrawer';
29-
export { default as ClFlex } from './flex';
30-
export { default as ClGrid } from './grid';
31-
export { default as ClAnimation } from './animation';
1+
export {default as ClAvatar} from './avatar';
2+
export {default as ClButton} from './button';
3+
export {default as ClCheckbox} from './checkbox';
4+
export {default as ClDrawer} from './drawer';
5+
export {default as ClIcon} from './icon';
6+
export {default as ClInput} from './input';
7+
export {default as ClLayout} from './layout';
8+
export {default as ClLoading} from './loading';
9+
export {default as ClMenuList} from './menuList';
10+
export {default as ClModal} from './modal';
11+
export {default as ClNavBar} from './navBar';
12+
export {default as ClProgress} from './progress';
13+
export {default as ClRadio} from './radio';
14+
export {default as ClSearchBar} from './searchBar';
15+
export {default as ClSelect} from './select';
16+
export {default as ClShopBar} from './shopBar';
17+
export {default as ClStep} from './steps';
18+
export {default as ClSwiper} from './swiper';
19+
export {default as ClSwitch} from './switch';
20+
export {default as ClTabBar} from './tabBar';
21+
export {default as ClTabs} from './tabs';
22+
export {default as ClTag} from './tag';
23+
export {default as ClText} from './text';
24+
export {default as ClTimeline} from './timeline';
25+
export {default as ClTitleBar} from './titleBar';
26+
export {default as ClImagePicker} from './imagePicker';
27+
export {default as ClCard} from './card';
28+
export {default as ClScreenDrawer} from './screenDrawer';
29+
export {default as ClFlex} from './flex';
30+
export {default as ClGrid} from './grid';
31+
export {default as ClAnimation} from './animation';
3232
export {default as ClVerticalTab} from './verticalTab';
33-
export {default as CLVerticalTabCell} from './verticalTabCell';
33+
export {default as ClVerticalTabCell} from './verticalTabCell';

@types/tabs.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,25 @@ export interface IProps {
3939
/**
4040
* 标题
4141
*/
42-
text?: string;
42+
text: string;
4343
/**
4444
* 图标,可选类型请查看 Icon-iconName
4545
*/
4646
icon?: iconType;
47+
/**
48+
* 标签唯一标识符
49+
*/
50+
id: string;
4751
}[];
4852
/**
4953
* 点击事件
5054
*/
5155
onClick?: (index: number) => void;
56+
/**
57+
* 是否可以拖动内容移动 tab
58+
*/
59+
touchMove?: boolean;
60+
children?: any;
5261
}
5362

5463
export interface TabsProps extends IProps {}

@types/verticalTab.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export interface IProps {
1616
* 当前激活的标签页 Id
1717
*/
1818
current?: string;
19+
/**
20+
* 点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部
21+
*/
22+
backTop?: boolean;
1923
children?: any;
2024
}
2125

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# MP-COLORUI 是基于 Taro框架的组件库
1+
# MP-COLORUI 是基于 Taro 框架的组件库
22

33
## 使用方式
44

5-
> 安装:`npm i mp-colorui`
5+
> 安装:`npm i mp-colorui``yarn add mp-colorui`
6+
67
> 具体文档请查看:[MP-ColorUI 文档](https://yinliangdream.github.io/mp-colorui-doc/#/)
78
89
## *注意*

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mp-colorui",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(目前仅支持小程序端)",
55
"main": "dist/index.js",
66
"main:h5": "dist/h5/index.js",

src/components/animation/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ export default function ClAnimation(props: IProps) {
66
const type = props.type;
77
const reverse = props.reverse ? 'animation-reverse' : '';
88
return (
9-
<View className={`animation-${type} ${reverse}`} style={{animationDelay: `${props.delay}s`}}>
9+
<View className={`animation-${type} ${reverse}`} style={{animationDelay: `${props.delay}s`}}
10+
onAnimationStart={e => {
11+
props.onAnimationStart && props.onAnimationStart(e)
12+
}} onAnimationEnd={e => {
13+
props.onAnimationEnd && props.onAnimationEnd(e)
14+
}}>
1015
{this.props.children}
1116
</View>
1217
)

src/components/card/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Taro from '@tarojs/taro';
2-
import { IProps } from '../../../@types/card.d';
32
import { View } from '@tarojs/components';
3+
import {IProps} from '../../../@types/card.d';
44
import { BG_COLOR_LIST } from '../utils/model';
55

66
export default function ClCard(props: IProps) {

src/components/tabs/index.scss

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.scrollx {
2+
width: 100%;
3+
white-space: nowrap;
4+
5+
view, div {
6+
width: 100%;
7+
height: 100px;
8+
display: inline-block;
9+
}
10+
}

0 commit comments

Comments
 (0)