import { Text, View } from "@tarojs/components"; import Taro, { Component } from "@tarojs/taro"; import { classNames } from "../../lib"; import { TEXT_COLOR_LIST } from "../../lib/model"; import { IProps } from "../../../@types/steps"; interface IState {} export default class ClStep extends Component { static options = { addGlobalClass: true }; static defaultProps: IProps = { steps: [], type: "line", activeColor: "blue", step: 0, stepIconType: "number", stepTitlePosition: "bottom" }; state: IState = {}; render(): any { const stepTypeClassName = this.props.type === "arrow" ? "steps-arrow" : ""; const activeColorClassName = this.props.activeColor ? TEXT_COLOR_LIST[this.props.activeColor] : ""; const step = this.props.step || 0; const tabsComponents = this.props.steps.map((item, index) => ( index ? activeColorClassName : ""}`} key={index} > {this.props.stepTitlePosition === "top" ? item.title : ""} { } {this.props.stepTitlePosition === "bottom" ? item.title : ""} )); return ( {tabsComponents} ); } }