🐳 chore(迁移仓库): 迁移仓库到新的仓库

This commit is contained in:
xuan
2022-08-29 16:36:38 +08:00
parent 5b5d4bb8e2
commit 9eb68f8d91
15 changed files with 167 additions and 28 deletions
+45
View File
@@ -0,0 +1,45 @@
.divider {
position: relative;
// 垂直
&-vertical {
display: inline-block;
width: 1px;
height: 1em;
margin: 0 8px;
border-left: 1px $borderStyle $borderColor;
vertical-align: middle;
}
// 水平
&-horizontal {
display: block;
width: 100%;
height: 1px;
margin: 48px 0;
border-top: 1px $borderStyle $borderColor;
}
&-text{
position: absolute;
text-align: center;
padding: 0 40px;
font-weight: 500;
font-size: 28px;
color: #333;
background-color: #fff;
}
}
.is{
&-center{
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
&-left{
left: 20px;
transform:translateY(-50%);
}
&-right{
right: 20px;
transform:translateY(-50%);
}
}
+57
View File
@@ -0,0 +1,57 @@
/**
* Usage:
*
* <View>巴拉巴拉小魔仙</View>
* <Divider direction="vertical" borderStyle="solid"></Divider
* <View>全身变</View>
*
*/
import { View } from "@tarojs/components";
import { FC, ReactNode } from "react";
import styles from "./index.module.scss";
import classnames from "classnames";
type BorderStype = 'solid' | 'dashed' | 'dotted' | 'double'
interface DividerProps {
direction?: "horizontal" | "vertical";
borderStyle?: BorderStype;
contentPosition?: "left" | "center" | "right";
children?: ReactNode;
}
const Divider: FC<DividerProps> = props => {
const {
direction = "horizontal",
borderStyle = "solid",
contentPosition = "center"
} = props;
const classname = classnames(
styles["divider"],
styles["divider-" + direction]
);
const contentClassname = classnames(
styles["divider-text"],
styles["is-" + contentPosition]
);
const borderTopStyle: { borderTopStyle: BorderStype } = {
borderTopStyle: borderStyle
};
const borderLeftStyle: { borderLeftStyle: BorderStype } = {
borderLeftStyle: borderStyle
};
const dividerStyle =
direction === "horizontal" ? borderTopStyle : borderLeftStyle;
return (
<View className={classname} style={dividerStyle}>
{props.children && direction !== "vertical" && (
<View className={contentClassname}>{props.children}</View>
)}
</View>
);
};
export default Divider
+1 -1
View File
@@ -17,4 +17,4 @@ export default memo(({onClose, styleObj = {}}:Params) => {
<Text className={`iconfont icon-qingkong ${style.icon_a_btn}`}></Text>
</View>
)
})
})
+2 -2
View File
@@ -25,7 +25,7 @@ export default memo(({list = [], defaultValue = 0, tabsOnClick, style={}}: Param
useEffect(() => {
const index = list?.findIndex(item => {
return item.value == defaultValue
return item.value == defaultValue
})
if(index !== -1) {
const num = index > 0?( index - 1) : 0
@@ -58,4 +58,4 @@ export default memo(({list = [], defaultValue = 0, tabsOnClick, style={}}: Param
</View>
</>
)
})
})