// @ts-nocheck import * as React from 'react'; import { Props, State } from './type'; import * as Styled from './index.style' import styled from 'styled-components' import {rem} from '../style/function.style' const InitBox = styled.div` height: ${rem(120)}; line-height: ${rem(120)}; text-align: center; margin-bottom:${props=>rem(props.marginBottom)}; ` export class BottomTab extends React.Component { public static defaultProps = new Props(); public state = new State(); // static getDerivedStateFromProps(props,state){ // if(!document.querySelector('.tab-blank')){ // if(props.bgc){ // let img = new Image() // img.src = props.bgc ? props.bgc.url : ''; // img.onload =function(){ // const tabDOM = document.querySelector('.tab-wrapper'); // const heightNum = tabDOM.clientHeight; // let blankDOM = document.createElement('div'); // blankDOM.style.cssText = ` // position:relative; // height:${heightNum}px; // width:100%; // ` // blankDOM.classList.add('tab-blank') // document.querySelector('.tab-container').appendChild(blankDOM) // } // } // } // } private switchTab = (url,e) => { // e.stopPropagation(); if(url) location.href = url } public render() { let { isEdit, style, tabs, marginBottom, bgc, marginTop, iconHeight} = this.props return { !bgc && isEdit && {'在跳转配置中添加tab项前 请先选择背景图片撑开tab'} } { (bgc) && (
{ bgc && }
{tabs && tabs?.map((item,index)=>{ return
icon {item.text && {item.text}}
})}
) }
} }