import React, { Component } from 'react' import Router from 'next/router' import { TabBar, Icon } from 'antd-mobile' export default class MenuBar extends Component { render () { const { pathname, children } = this.props return ( {tabBarData.map(({ title, icon, selectedIcon, link, dot, component: Component }) => ( } selectedIcon={} selected={pathname === link} onPress={() => Router.push(link)} > {children} ))} ) } } const tabBarData = [ { title: 'Home', icon: 'koubei-o', selectedIcon: 'koubei', link: '/home' }, { title: 'Trick', icon: 'check-circle-o', selectedIcon: 'check-circle', link: '/trick' } ]