import React from "react"; import HomeBtn from '../commen/homeBtn/index' import IconHtml from '../../../common/iconHtml/index' type defaultProps = {} type ContentData = {} & defaultProps interface LPData { content: Array, [propsName: string]: any } interface LPType { content: any, [propsName: string]: any } type IPropTypes = { source?: ContentData, [propsName: string]: any } const CLASS = 'm-pageNav-'; class WordNav extends React.Component { constructor(props) { super(props); this.state = { source: [], } } componentDidMount() { } goPage(href) { if (this.props.env == 'isMp') { this.props.goMpPath(href); } else { window.location.href = href } } render() { let source = this.props; let content = source; return (
{ content ?
{ content.useHomeBtn ? : '' } { content.pageList && content.pageList.length > 0 ? content.pageList.map((item, index) => { let num = content.pageList.length; if (content.useHomeBtn) { if (num <= 2) { num = 2; } else { num = 5; } } if (window.location.href.indexOf(item.link) >= 0) { item.active = true } else { item.active = false } return ( ) }) : "" }
: '' }
); } } export default WordNav;