Commit 8b57a405 by zhangleyuan

feat:修改左侧导航的折叠展开的效果

parent 1d2823bf
@font-face { @font-face {
font-family: 'iconfont'; /* project id 81196 */ font-family: 'iconfont'; /* project id 2223403 */
src: url('//at.alicdn.com/t/font_81196_rurla8utrha.eot'); src: url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.eot');
src: url('//at.alicdn.com/t/font_81196_rurla8utrha.eot?#iefix') format('embedded-opentype'), src: url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_81196_rurla8utrha.woff2') format('woff2'), url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.woff2') format('woff2'),
url('//at.alicdn.com/t/font_81196_rurla8utrha.woff') format('woff'), url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.woff') format('woff'),
url('//at.alicdn.com/t/font_81196_rurla8utrha.ttf') format('truetype'), url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.ttf') format('truetype'),
url('//at.alicdn.com/t/font_81196_rurla8utrha.svg#iconfont') format('svg'); url('//at.alicdn.com/t/font_2223403_13iutf1by4j8.svg#iconfont') format('svg');
} }
.iconfont{
.iconfont{ font-family:"iconfont" !important;
font-family:"iconfont" !important; font-size:16px;
font-size:16px; font-style:normal;
font-style:normal;
} }
\ No newline at end of file
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-07-10 10:30:49 * @Date: 2019-07-10 10:30:49
* @LastEditors: wufan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-08 15:34:13 * @LastEditTime: 2020-12-08 20:09:55
* @Description: * @Description:
*/ */
import React, { useContext, useEffect } from 'react'; import React, { useContext, useEffect, useState } from 'react';
import { withRouter} from 'react-router-dom'; import { withRouter} from 'react-router-dom';
import {ConfigProvider } from 'antd'; import {ConfigProvider } from 'antd';
import Header from './Header' import Header from './Header'
...@@ -23,7 +23,7 @@ declare var window: any; ...@@ -23,7 +23,7 @@ declare var window: any;
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const userId = User.getUserId(); const userId = User.getUserId();
const [menuType,setMenuType] = useState(true)
window.ctx = ctx; window.ctx = ctx;
useEffect(() => { useEffect(() => {
...@@ -62,10 +62,10 @@ const App: React.FC = (props: any) => { ...@@ -62,10 +62,10 @@ const App: React.FC = (props: any) => {
return ( return (
<div id="home"> <div id="home">
<Header/> <Header/>
<ConfigProvider locale={zhCN}> <ConfigProvider locale={zhCN} >
<Main/> <Main/>
</ConfigProvider> </ConfigProvider>
<Menu /> <Menu/>
</div> </div>
) )
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-09-10 18:26:03 * @Date: 2019-09-10 18:26:03
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-08 19:33:46 * @LastEditTime: 2020-12-08 20:09:40
* @Description: * @Description:
*/ */
import React , { useContext, useEffect ,useState}from 'react'; import React , { useContext, useEffect ,useState}from 'react';
...@@ -22,6 +22,7 @@ import { XMContext } from '@/store/context'; ...@@ -22,6 +22,7 @@ import { XMContext } from '@/store/context';
import baseImg from '@/common/images/xiaomai-IMG.png'; import baseImg from '@/common/images/xiaomai-IMG.png';
import logoImg from '@/common/images/logo.png'; import logoImg from '@/common/images/logo.png';
const { confirm } = Modal; const { confirm } = Modal;
function Header(){ function Header(){
const [menuType, setMenuType] = useState(true); const [menuType, setMenuType] = useState(true);
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
...@@ -54,7 +55,7 @@ function Header(){ ...@@ -54,7 +55,7 @@ function Header(){
); );
} }
function handleMenu(){ function handleMenu(){
setMenuType(!menuType) setMenuType(!menuType);
}; };
function toPersonalInfoPage(){ function toPersonalInfoPage(){
window.RCHistory.push({ window.RCHistory.push({
...@@ -90,7 +91,9 @@ function Header(){ ...@@ -90,7 +91,9 @@ function Header(){
<div className="top top-nav"> <div className="top top-nav">
<div> <div>
<img src={logoImg} className="logo" alt="" /> <img src={logoImg} className="logo" alt="" />
{menuType && (
<span className="logo-name">小麦云课堂</span> <span className="logo-name">小麦云课堂</span>
)}
</div> </div>
{menuType ? ( {menuType ? (
<span className="icon iconfont cursor ml20 handLike" onClick={handleMenu}> <span className="icon iconfont cursor ml20 handLike" onClick={handleMenu}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment