Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-www-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-www-h5
Commits
9c9a854b
提交
9c9a854b
authored
4月 24, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
38abaf15
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
187 行增加
和
29 行删除
+187
-29
icon_close.png
assets/images/icon_close.png
+0
-0
icon_menu.png
assets/images/icon_menu.png
+0
-0
icon_search.png
assets/images/icon_search.png
+0
-0
icon_search_hover.png
assets/images/icon_search_hover.png
+0
-0
Header.vue
components/Header.vue
+99
-8
Menu.vue
components/Menu.vue
+2
-2
Search.vue
components/Search.vue
+54
-2
TreeItem.vue
components/TreeItem.vue
+3
-11
default.vue
layouts/default.vue
+12
-4
nuxt.config.js
nuxt.config.js
+4
-2
index.js
store/index.js
+13
-0
没有找到文件。
assets/images/icon_close.png
0 → 100644
浏览文件 @
9c9a854b
1.6 KB
assets/images/ico
m
_menu.png
→
assets/images/ico
n
_menu.png
浏览文件 @
9c9a854b
File moved
assets/images/ico
m
_search.png
→
assets/images/ico
n
_search.png
浏览文件 @
9c9a854b
File moved
assets/images/icon_search_hover.png
0 → 100644
浏览文件 @
9c9a854b
2.7 KB
components/Header.vue
浏览文件 @
9c9a854b
<
template
>
<
template
>
<div>
<div>
<header
class=
"main-header"
>
<header
class=
"main-header"
>
<nuxt-link
to=
"/"
class=
"logo"
></nuxt-link>
<template
v-if=
"!searchVisible"
>
<div
class=
"search"
></div>
<nuxt-link
to=
"/"
class=
"logo"
></nuxt-link>
<div
class=
"menu"
></div>
<div
class=
"search"
@
click=
"toggleSearch"
></div>
<div
class=
"menu"
:class=
"menuClasses"
@
click=
"toggleMenu"
></div>
</
template
>
<div
class=
"search-box"
v-else
>
<div
class=
"search-inner"
>
<input
type=
"text"
placeholder=
"请输入关键词"
class=
"search-input"
ref=
"search"
/>
<div
class=
"search-btn"
@
click=
"search"
></div>
</div>
<div
class=
"search-close"
@
click=
"toggleSearch"
></div>
</div>
</header>
</header>
<app-menu></app-menu>
<app-search
v-if=
"searchVisible"
></app-search>
<app-menu
v-show=
"menuVisible"
></app-menu>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
AppMenu
from
'@/components/Menu'
import
AppMenu
from
'@/components/Menu'
import
AppSearch
from
'@/components/Search'
export
default
{
export
default
{
components
:
{
AppMenu
}
components
:
{
AppMenu
,
AppSearch
},
data
()
{
return
{}
},
computed
:
{
searchVisible
()
{
return
this
.
$store
.
state
.
searchVisible
},
menuVisible
()
{
return
this
.
$store
.
state
.
menuVisible
},
menuClasses
()
{
return
{
'is-open'
:
this
.
menuVisible
}
}
},
watch
:
{
$route
()
{
this
.
$store
.
commit
(
'toggleSearch'
,
false
)
this
.
$store
.
commit
(
'toggleMenu'
,
false
)
}
},
methods
:
{
toggleSearch
()
{
this
.
$store
.
commit
(
'toggleSearch'
,
!
this
.
searchVisible
)
this
.
searchVisible
&&
this
.
$nextTick
(()
=>
{
this
.
$refs
.
search
.
focus
()
})
},
toggleMenu
()
{
this
.
$store
.
commit
(
'toggleMenu'
,
!
this
.
menuVisible
)
},
search
()
{
this
.
$notify
({
type
:
'primary'
,
message
:
'暂未开通,尽请期待'
})
}
}
}
}
</
script
>
</
script
>
...
@@ -23,7 +71,7 @@ export default {
...
@@ -23,7 +71,7 @@ export default {
align-items
:
center
;
align-items
:
center
;
padding
:
0
.16rem
0
.15rem
0
.2rem
;
padding
:
0
.16rem
0
.15rem
0
.2rem
;
background-color
:
#fff
;
background-color
:
#fff
;
border-top
:
10px
solid
#aa1941
;
border-top
:
0
.05rem
solid
#aa1941
;
box-shadow
:
0px
0px
15px
rgba
(
0
,
0
,
0
,
0
.14
);
box-shadow
:
0px
0px
15px
rgba
(
0
,
0
,
0
,
0
.14
);
.logo
{
.logo
{
flex
:
1
;
flex
:
1
;
...
@@ -35,15 +83,58 @@ export default {
...
@@ -35,15 +83,58 @@ export default {
width
:
0
.18rem
;
width
:
0
.18rem
;
height
:
0
.18rem
;
height
:
0
.18rem
;
padding
:
0
0
.08rem
;
padding
:
0
0
.08rem
;
background
:
url('~/assets/images/ico
m
_search.png')
no-repeat
center
;
background
:
url('~/assets/images/ico
n
_search.png')
no-repeat
center
;
background-size
:
0
.18rem
0
.18rem
;
background-size
:
0
.18rem
0
.18rem
;
cursor
:
pointer
;
}
}
.menu
{
.menu
{
width
:
0
.18rem
;
width
:
0
.18rem
;
height
:
0
.18rem
;
height
:
0
.18rem
;
padding
:
0
0
.08rem
;
padding
:
0
0
.08rem
;
background
:
url('~/assets/images/ico
m
_menu.png')
no-repeat
center
;
background
:
url('~/assets/images/ico
n
_menu.png')
no-repeat
center
;
background-size
:
0
.18rem
0
.18rem
;
background-size
:
0
.18rem
0
.18rem
;
cursor
:
pointer
;
&
.is-open
{
background
:
url('~/assets/images/icon_close.png')
no-repeat
center
;
background-size
:
0
.18rem
0
.18rem
;
}
}
.search-box
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
.search-inner
{
height
:
0
.24rem
;
flex
:
1
;
display
:
flex
;
border
:
0
.01rem
solid
#eaeaea
;
border-radius
:
0
.03rem
;
overflow
:
hidden
;
}
.search-input
{
flex
:
1
;
height
:
100%
;
padding
:
0
0
.1rem
;
border
:
0
;
}
.search-btn
{
width
:
0
.18rem
;
height
:
100%
;
padding
:
0
0
.05rem
;
background
:
url('~/assets/images/icon_search_hover.png')
no-repeat
center
;
background-size
:
0
.18rem
0
.18rem
;
cursor
:
pointer
;
}
.search-close
{
margin-left
:
0
.02rem
;
width
:
0
.18rem
;
height
:
0
.18rem
;
padding
:
0
0
.08rem
;
background
:
url('~/assets/images/icon_close.png')
no-repeat
center
;
background-size
:
0
.18rem
0
.18rem
;
cursor
:
pointer
;
}
}
}
}
}
</
style
>
</
style
>
components/Menu.vue
浏览文件 @
9c9a854b
...
@@ -104,9 +104,9 @@ export default {
...
@@ -104,9 +104,9 @@ export default {
// right: 0;
// right: 0;
// top: 0.62rem;
// top: 0.62rem;
// bottom: 0;
// bottom: 0;
background-color
:
#fff
;
// z-index: 100;
padding
:
0
0
.15rem
;
padding
:
0
0
.15rem
;
min-height
:
100vh
;
background-color
:
#fff
;
.first
>
.cell
.cell-title
{
.first
>
.cell
.cell-title
{
font-size
:
0
.14rem
;
font-size
:
0
.14rem
;
font-weight
:
bold
;
font-weight
:
bold
;
...
...
components/Search.vue
浏览文件 @
9c9a854b
<
template
>
<
template
>
<div></div>
<div
class=
"app-search"
>
<div
class=
"hot-search"
>
<h2
class=
"hot-search__title"
>
热门搜索
</h2>
<ul
class=
"hot-search__list"
>
<li
v-for=
"(item, index) in hotList"
:key=
"index"
>
<nuxt-link
:to=
"item.path"
v-if=
"item.path"
>
{{
item
.
name
}}
</nuxt-link>
<a
:href=
"item.href"
v-else-if=
"item.href"
target=
"_blank"
>
{{
item
.
name
}}
</a>
<template
v-else
>
{{
item
.
name
}}
</
template
>
</li>
</ul>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
export
default
{}
export
default
{
data
()
{
return
{
hotList
:
[
{
name
:
'1+x'
,
href
:
'https://x.ezijing.com'
},
{
name
:
'金融'
,
href
:
'https://kelley.ezijing.com'
},
{
name
:
'MBA'
,
href
:
'https://sofia.ezijing.com'
},
{
name
:
'心理学'
,
href
:
'https://ciis.ezijing.com'
},
{
name
:
'新闻'
,
path
:
'/about/news'
}
]
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
.app-search
{
padding
:
0
0
.15rem
;
min-height
:
100vh
;
background-color
:
#fff
;
}
.hot-search
{
}
.hot-search__title
{
padding
:
0
.2rem
0
;
font-size
:
0
.12rem
;
font-weight
:
400
;
color
:
#333
;
border-bottom
:
1px
solid
#999
;
}
.hot-search__list
{
li
{
font-size
:
0
.14rem
;
color
:
#333
;
font-weight
:
500
;
line-height
:
0
.52rem
;
border-bottom
:
1px
solid
#999
;
}
a
{
display
:
block
;
}
}
</
style
>
components/TreeItem.vue
浏览文件 @
9c9a854b
...
@@ -3,19 +3,11 @@
...
@@ -3,19 +3,11 @@
<div
class=
"cell"
:class=
"
{ bold: isFolder }" @click="toggle">
<div
class=
"cell"
:class=
"
{ bold: isFolder }" @click="toggle">
<div
class=
"cell-title"
>
<div
class=
"cell-title"
>
<!-- 站内跳转 -->
<!-- 站内跳转 -->
<template
v-if=
"item.path"
>
<nuxt-link
:to=
"item.path"
v-if=
"item.path"
>
{{
item
.
name
}}
</nuxt-link>
<nuxt-link
:to=
"item.path"
>
{{
item
.
name
}}
</nuxt-link>
</
template
>
<!-- 外部链接跳转 -->
<!-- 外部链接跳转 -->
<
template
v-else-if=
"item.href"
>
<a
:href=
"item.href"
target=
"_blank"
v-else-if=
"item.href"
>
{{
item
.
name
}}
</a>
<a
:href=
"item.href"
target=
"_blank"
>
{{
item
.
name
}}
</a>
</
template
>
<!-- 事件 -->
<!-- 事件 -->
<
template
v-else-if=
"item.onClick"
>
<div
@
click=
"item.onClick"
v-else-if=
"item.onClick"
>
{{
item
.
name
}}
</div>
<div
@
click=
"item.onClick"
>
{{
item
.
name
}}
</div>
</
template
>
<template
v-else
>
{{
item
.
name
}}
</
template
>
<template
v-else
>
{{
item
.
name
}}
</
template
>
</div>
</div>
<div
class=
"cell-icon"
v-if=
"isFolder"
>
<div
class=
"cell-icon"
v-if=
"isFolder"
>
...
...
layouts/default.vue
浏览文件 @
9c9a854b
<
template
>
<
template
>
<div
class=
"main-layout"
>
<div
class=
"main-layout"
:class=
"
{ 'is-fixed': isFixed }"
>
<app-header
/>
<app-header
/>
<Nuxt
/>
<div
v-show=
"!isFixed"
>
<app-footer
/>
<Nuxt
/>
<app-footer
/>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -10,6 +12,12 @@
...
@@ -10,6 +12,12 @@
import
AppHeader
from
'@/components/Header'
import
AppHeader
from
'@/components/Header'
import
AppFooter
from
'@/components/Footer'
import
AppFooter
from
'@/components/Footer'
export
default
{
export
default
{
components
:
{
AppHeader
,
AppFooter
}
components
:
{
AppHeader
,
AppFooter
},
computed
:
{
isFixed
()
{
const
{
searchVisible
,
menuVisible
}
=
this
.
$store
.
state
return
searchVisible
||
menuVisible
}
}
}
}
</
script
>
</
script
>
nuxt.config.js
浏览文件 @
9c9a854b
...
@@ -14,8 +14,10 @@ export default {
...
@@ -14,8 +14,10 @@ export default {
},
},
meta
:
[
meta
:
[
{
charset
:
'utf-8'
},
{
charset
:
'utf-8'
},
{
name
:
'viewport'
,
content
:
'width=device-width, initial-scale=1'
},
{
{
hid
:
'description'
,
name
:
'description'
,
content
:
''
},
name
:
'viewport'
,
content
:
'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover'
},
{
{
name
:
'keywords'
,
name
:
'keywords'
,
content
:
content
:
...
...
store/index.js
0 → 100644
浏览文件 @
9c9a854b
export
const
state
=
()
=>
({
searchVisible
:
false
,
menuVisible
:
false
})
export
const
mutations
=
{
toggleSearch
(
state
,
visible
)
{
state
.
searchVisible
=
visible
},
toggleMenu
(
state
,
visible
)
{
state
.
menuVisible
=
visible
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论