|
|
@@ -70,19 +70,23 @@ export default {
|
|
|
},
|
|
|
search() {
|
|
|
this.$refs.search.blur()
|
|
|
- /* this.$router.push({
|
|
|
- path: '/search/result',
|
|
|
- query: {
|
|
|
- keyword: this.text
|
|
|
- }
|
|
|
- })*/
|
|
|
- const routeUrl = this.$router.resolve({
|
|
|
- path: '/search/result',
|
|
|
- query: {
|
|
|
- keyword: this.text
|
|
|
- }
|
|
|
- })
|
|
|
- window.open(routeUrl.href, '_blank')
|
|
|
+ const currentUrl = this.$route.path
|
|
|
+ if (currentUrl === '/search/result') {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/search/result',
|
|
|
+ query: {
|
|
|
+ keyword: this.text
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const routeUrl = this.$router.resolve({
|
|
|
+ path: '/search/result',
|
|
|
+ query: {
|
|
|
+ keyword: this.text
|
|
|
+ }
|
|
|
+ })
|
|
|
+ window.open(routeUrl.href, '_blank')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|