Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project
jinfa-admin
Commits
3a25aa40
Commit
3a25aa40
authored
Jan 04, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加logo
parent
c2e522d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
6 deletions
+52
-6
Logo.tsx
src/layouts/components/Logo.tsx
+30
-6
index.ts
src/module/globalModule/index.ts
+5
-0
index.ts
src/store/global/index.ts
+17
-0
No files found.
src/layouts/components/Logo.tsx
View file @
3a25aa40
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
);
src/module/globalModule/index.ts
0 → 100644
View file @
3a25aa40
export
interface
GlobalModule
{
globalCollapsed
:
boolean
;
setGlobalCollapsed
(
data
:
boolean
):
void
;
}
src/store/global/index.ts
0 → 100644
View file @
3a25aa40
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment