antd-mobile tabbar 路由左右切换动画

1、安装react-animated-router

yarn add react-animated-router

2、引入

import AnimatedRouter from 'react-animated-router'; 
import 'react-animated-router/animate.css'; //引入默认的动画样式定义

3、在layout中使用

render() {
    const { children, location, loading, route } = this.props;
    //去除tabbar的其他路由
    if (BarRoutes.indexOf(location.pathname) < 0) {
      return (
        
{children}
) } //Tabbar路由 return (
{children}
); }

 

你可能感兴趣的:(antd-mobile tabbar 路由左右切换动画)