Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
Add search route
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoandy107 committed Jan 13, 2019
1 parent 933a246 commit d359a85
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/public/header/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
v-model="value"
:fetch-suggestions="querySearchAsync"
placeholder="請輸入內容"
@select="searchCommit"
>
<el-button
slot="append"
icon="el-icon-search"
@click="searchCommit"
/>
</el-autocomplete>
</el-col>
Expand Down Expand Up @@ -37,7 +39,12 @@ export default {
clearTimeout(this.timeout)
this.timeout = setTimeout(() => {
callback(searchResult)
}, 2000 * Math.random())
}, 1000 * Math.random())
},
searchCommit() {
this.$router.push({
path: `/good?keyword=${this.value}`
})
}
}
}
Expand Down

0 comments on commit d359a85

Please sign in to comment.