Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
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
Damon
study
Commits
1b48012e
Commit
1b48012e
authored
Jul 26, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 搜索不输入内容兼容
parent
21f1b24d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
detail.vue
src/pages/search/detail.vue
+8
-6
index.vue
src/pages/search/index.vue
+8
-6
No files found.
src/pages/search/detail.vue
View file @
1b48012e
...
...
@@ -176,13 +176,15 @@ export default {
this
.
arrIndex
=
e
.
show
?
e
.
index
:
null
},
search
(
val
)
{
this
.
keyword
=
val
let
history
=
this
.
searchHistory
history
.
unshift
(
val
)
if
(
history
.
length
>
9
)
{
history
.
splice
(
9
,
1
)
if
(
val
){
this
.
keyword
=
val
let
history
=
this
.
searchHistory
history
.
unshift
(
val
)
if
(
history
.
length
>
9
)
{
history
.
splice
(
9
,
1
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
history
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
history
)
},
collection
(
item
)
{
const
action
=
item
.
collectionFlag
?
'removeCollection'
:
'joinCollection'
...
...
src/pages/search/index.vue
View file @
1b48012e
...
...
@@ -62,13 +62,15 @@ export default {
},
methods
:
{
search
(
val
)
{
this
.
keyword
=
val
this
.
history
.
unshift
(
val
)
if
(
this
.
history
.
length
>
9
){
this
.
history
.
splice
(
9
,
1
)
if
(
val
){
this
.
keyword
=
val
this
.
history
.
unshift
(
val
)
if
(
this
.
history
.
length
>
9
){
this
.
history
.
splice
(
9
,
1
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
this
.
history
)
this
.
toSearchDetail
(
val
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
this
.
history
)
this
.
toSearchDetail
(
val
)
},
toSearchDetail
(
keyword
)
{
this
.
$u
.
route
({
...
...
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