Showing
1 changed file
with
6 additions
and
3 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-20 16:57:48 | 2 | * @Date: 2024-10-20 16:57:48 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-10-25 18:13:06 | 4 | + * @LastEditTime: 2024-10-26 14:28:58 |
| 5 | * @FilePath: /hager/src/views/search.vue | 5 | * @FilePath: /hager/src/views/search.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -109,9 +109,12 @@ export default { | ... | @@ -109,9 +109,12 @@ export default { |
| 109 | } | 109 | } |
| 110 | }, | 110 | }, |
| 111 | watch: { | 111 | watch: { |
| 112 | - '$route.query.keyword': function(newKeyword) { | 112 | + '$route.query.keyword': function(newKeyword, oldKeyword) { |
| 113 | this.keyword = newKeyword || ''; | 113 | this.keyword = newKeyword || ''; |
| 114 | - this.getList(); | 114 | + if (newKeyword !== oldKeyword) { |
| 115 | + this.activeName = 'product'; | ||
| 116 | + this.getList(); | ||
| 117 | + } | ||
| 115 | }, | 118 | }, |
| 116 | }, | 119 | }, |
| 117 | async mounted () { | 120 | async mounted () { | ... | ... |
-
Please register or login to post a comment