Commit 3a25aa40 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 添加logo

parent c2e522d1
import React from 'react'
import React, { useEffect, useState } from 'react'
import styles from '../index.less'
import logo from '@/asserts/logo.svg'
import logoSmall from '@/asserts/logo-small.svg'
export default () => (
<div className={styles.lxLogoWrap}>
<span>平台后台</span>
import { observer } from 'mobx-react'
import { store } from '@/store'
const { indexStore } = store
const logoEle: React.FC<{}> = () => {
const { globalCollapsed } = indexStore
const [showSmall, setShowSmall] = useState<boolean>(false)
useEffect(() => {
setShowSmall(globalCollapsed)
}, [globalCollapsed])
return <div className={styles.lxLogoWrap}>
<p>
{
showSmall ?
<img src={logoSmall} alt="瓴犀"/>
:
<>
<img src={logo} alt="瓴犀"/>
<span>平台后台</span>
</>
}
</p>
</div>
)
\ No newline at end of file
}
export default observer(logoEle);
export interface GlobalModule {
globalCollapsed: boolean;
setGlobalCollapsed(data: boolean): void;
}
import {action, observable} from 'mobx'
import { GlobalModule } from '@/module/globalModule'
/**
* 存储页面通用的一些状态
*/
class GlobalStore implements GlobalModule {
@observable public globalCollapsed: boolean = false; // 菜单是否折叠
@action.bound
public setGlobalCollapsed(data: boolean) {
this.globalCollapsed = data;
}
}
export default GlobalStore;
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