Skip to content

Commit c323c2f

Browse files
committed
更新版本,引入SwiperAction
1 parent b1ee4eb commit c323c2f

File tree

4 files changed

+105
-95
lines changed

4 files changed

+105
-95
lines changed

@types/index.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ export { default as ClDivider } from './divider';
3737
export { default as ClForm } from './form';
3838
export { default as ClFormItem } from './formItem';
3939
export { default as ClTip } from './tip';
40+
export { default as ClSwiperAction } from './swiperAction'
4041

41-
export { default as ClUtils } from './utils';
42+
export { default as ClUtils } from './utils';

package.json

+93-93
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
11
{
2-
"name": "mp-colorui",
3-
"version": "0.4.8",
4-
"description": "MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(支持小程序端和H5端)",
5-
"keywords": [
6-
"taro",
7-
"mp-colorui",
8-
"colorui"
9-
],
10-
"main": "dist/index.js",
11-
"main:h5": "dist/h5/index.js",
12-
"types": "./@types/index.d.ts",
13-
"repository": "https://github.com/yinLiangDream/mp-colorui",
14-
"homepage": "https://yinliangdream.github.io/mp-colorui-doc/#/",
15-
"files": [
16-
"dist",
17-
"@types"
18-
],
19-
"scripts": {
20-
"build:weapp": "taro build --type weapp",
21-
"build:swan": "taro build --type swan",
22-
"build:alipay": "taro build --type alipay",
23-
"build:h5": "taro build --type h5",
24-
"build:rn": "taro build --type rn",
25-
"dev:weapp": "npm run build:weapp -- --watch",
26-
"dev:swan": "npm run build:swan -- --watch",
27-
"dev:alipay": "npm run build:alipay -- --watch",
28-
"dev:h5": "npm run build:h5 -- --watch",
29-
"dev:rn": "npm run build:rn -- --watch",
30-
"lint": "eslint ./src --fix",
31-
"test": "jest --coverage",
32-
"build": "TARO_BUILD_TYPE=ui taro build --ui",
33-
"publish:beta": "npm run build & npm publish --tag=beta",
34-
"publish:production": "npm run build & npm publish"
35-
},
36-
"lint-staged": {
37-
"*.{js,ts,tsx,jsx}": [
38-
"eslint --quiet --cache --fix",
39-
"git add"
40-
]
41-
},
42-
"author": "liangyin",
43-
"license": "MIT",
44-
"dependencies": {
45-
"area-data": "^5.0.6"
46-
},
47-
"devDependencies": {
48-
"@babel/core": "^7.4.5",
49-
"@babel/plugin-proposal-class-properties": "^7.4.4",
50-
"@babel/plugin-transform-react-jsx": "^7.3.0",
51-
"@babel/preset-env": "^7.1.0",
52-
"@tarojs/async-await": "1.3.15",
53-
"@tarojs/components": "1.3.15",
54-
"@tarojs/plugin-babel": "1.3.15",
55-
"@tarojs/plugin-csso": "1.3.15",
56-
"@tarojs/plugin-sass": "1.3.15",
57-
"@tarojs/plugin-uglifyjs": "1.3.15",
58-
"@tarojs/router": "1.3.15",
59-
"@tarojs/taro": "1.3.15",
60-
"@tarojs/taro-alipay": "1.3.15",
61-
"@tarojs/taro-h5": "1.3.15",
62-
"@tarojs/taro-swan": "1.3.15",
63-
"@tarojs/taro-weapp": "1.3.15",
64-
"@tarojs/webpack-runner": "1.3.15",
65-
"@types/react": "^16.8.20",
66-
"@types/sinon": "^5.0.7",
67-
"@types/webpack-env": "^1.13.9",
68-
"babel-core": "^7.0.0-bridge.0",
69-
"babel-eslint": "^10.0.1",
70-
"babel-jest": "^24.8.0",
71-
"babel-plugin-transform-class-properties": "^6.24.1",
72-
"babel-plugin-transform-decorators-legacy": "^1.3.5",
73-
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
74-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
75-
"babel-preset-env": "^1.7.0",
76-
"cross-env": "^5.2.0",
77-
"eslint": "^6.1.0",
78-
"eslint-config-taro": "1.3.15",
79-
"eslint-plugin-import": "^2.17.3",
80-
"eslint-plugin-react": "^7.13.0",
81-
"eslint-plugin-react-hooks": "^2.0.1",
82-
"eslint-plugin-taro": "1.3.15",
83-
"husky": "^2.4.1",
84-
"jest": "^24.8.0",
85-
"lint-staged": "^8.0.3",
86-
"nerv-server": "^1.4.0",
87-
"nerv-test-utils": "^1.4.0",
88-
"nervjs": "^1.4.4",
89-
"regenerator-runtime": "^0.12.1",
90-
"simulant": "^0.2.2",
91-
"sinon": "^7.3.2",
92-
"tslint": "^5.19.0",
93-
"typescript": "^3.5.2"
94-
}
2+
"name": "mp-colorui",
3+
"version": "0.4.9",
4+
"description": "MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(支持小程序端和H5端)",
5+
"keywords": [
6+
"taro",
7+
"mp-colorui",
8+
"colorui"
9+
],
10+
"main": "dist/index.js",
11+
"main:h5": "dist/h5/index.js",
12+
"types": "./@types/index.d.ts",
13+
"repository": "https://github.com/yinLiangDream/mp-colorui",
14+
"homepage": "https://yinliangdream.github.io/mp-colorui-doc/#/",
15+
"files": [
16+
"dist",
17+
"@types"
18+
],
19+
"scripts": {
20+
"build:weapp": "taro build --type weapp",
21+
"build:swan": "taro build --type swan",
22+
"build:alipay": "taro build --type alipay",
23+
"build:h5": "taro build --type h5",
24+
"build:rn": "taro build --type rn",
25+
"dev:weapp": "npm run build:weapp -- --watch",
26+
"dev:swan": "npm run build:swan -- --watch",
27+
"dev:alipay": "npm run build:alipay -- --watch",
28+
"dev:h5": "npm run build:h5 -- --watch",
29+
"dev:rn": "npm run build:rn -- --watch",
30+
"lint": "eslint ./src --fix",
31+
"test": "jest --coverage",
32+
"build": "TARO_BUILD_TYPE=ui taro build --ui",
33+
"publish:beta": "npm run build & npm publish --tag=beta",
34+
"publish:production": "npm run build & npm publish"
35+
},
36+
"lint-staged": {
37+
"*.{js,ts,tsx,jsx}": [
38+
"eslint --quiet --cache --fix",
39+
"git add"
40+
]
41+
},
42+
"author": "liangyin",
43+
"license": "MIT",
44+
"dependencies": {
45+
"area-data": "^5.0.6"
46+
},
47+
"devDependencies": {
48+
"@babel/core": "^7.4.5",
49+
"@babel/plugin-proposal-class-properties": "^7.4.4",
50+
"@babel/plugin-transform-react-jsx": "^7.3.0",
51+
"@babel/preset-env": "^7.1.0",
52+
"@tarojs/async-await": "1.3.15",
53+
"@tarojs/components": "1.3.15",
54+
"@tarojs/plugin-babel": "1.3.15",
55+
"@tarojs/plugin-csso": "1.3.15",
56+
"@tarojs/plugin-sass": "1.3.15",
57+
"@tarojs/plugin-uglifyjs": "1.3.15",
58+
"@tarojs/router": "1.3.15",
59+
"@tarojs/taro": "1.3.15",
60+
"@tarojs/taro-alipay": "1.3.15",
61+
"@tarojs/taro-h5": "1.3.15",
62+
"@tarojs/taro-swan": "1.3.15",
63+
"@tarojs/taro-weapp": "1.3.15",
64+
"@tarojs/webpack-runner": "1.3.15",
65+
"@types/react": "^16.8.20",
66+
"@types/sinon": "^5.0.7",
67+
"@types/webpack-env": "^1.13.9",
68+
"babel-core": "^7.0.0-bridge.0",
69+
"babel-eslint": "^10.0.1",
70+
"babel-jest": "^24.8.0",
71+
"babel-plugin-transform-class-properties": "^6.24.1",
72+
"babel-plugin-transform-decorators-legacy": "^1.3.5",
73+
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
74+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
75+
"babel-preset-env": "^1.7.0",
76+
"cross-env": "^5.2.0",
77+
"eslint": "^6.1.0",
78+
"eslint-config-taro": "1.3.15",
79+
"eslint-plugin-import": "^2.17.3",
80+
"eslint-plugin-react": "^7.13.0",
81+
"eslint-plugin-react-hooks": "^2.0.1",
82+
"eslint-plugin-taro": "1.3.15",
83+
"husky": "^2.4.1",
84+
"jest": "^24.8.0",
85+
"lint-staged": "^8.0.3",
86+
"nerv-server": "^1.4.0",
87+
"nerv-test-utils": "^1.4.0",
88+
"nervjs": "^1.4.4",
89+
"regenerator-runtime": "^0.12.1",
90+
"simulant": "^0.2.2",
91+
"sinon": "^7.3.2",
92+
"tslint": "^5.19.0",
93+
"typescript": "^3.5.2"
94+
}
9595
}

src/components/swiperAction/index.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ export default function ClSwiperAction(props: IProps) {
7272
}, [translateX])
7373
useEffect(() => {
7474
setShow(!!props.show)
75-
}, [props.show])
75+
if (props.show) {
76+
if (props.direction === 'left') {
77+
setTranslateX(actionWidth)
78+
}
79+
else {
80+
setTranslateX(-actionWidth)
81+
}
82+
}
83+
}, [props.show, actionWidth])
7684
return (
7785
<View
7886
className='cl-swiper-action'

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ export { default as ClDivider } from './components/divider';
4646
export { default as ClForm } from './components/form';
4747
export { default as ClFormItem } from './components/form/formItem';
4848
export { default as ClTip } from './components/tip';
49+
export { default as ClSwiperAction } from './components/swiperAction'
4950

5051
Taro.initPxTransform({ designWidth: 750, deviceRatio: {} });

0 commit comments

Comments
 (0)