Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
jgdl
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-07-04 16:10:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c5a7b236f536da48fe9b3e14a90c53f35bc5a9e9
c5a7b236
1 parent
81376753
fix(SearchPopup): 修复导航栏标题在弹窗关闭时未重置的问题
将onMounted改为watch监听visible变化,在弹窗关闭时重置导航栏标题
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
src/components/SearchPopup.vue
src/components/SearchPopup.vue
View file @
c5a7b23
<!--
* @Date: 2025-01-20 00:00:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-04 16:
05:59
* @LastEditTime: 2025-07-04 16:
10:26
* @FilePath: /jgdl/src/components/SearchPopup.vue
* @Description: 搜索弹窗组件
-->
...
...
@@ -128,7 +128,7 @@
</template>
<script setup>
import { ref, computed,
onMounted
} from 'vue'
import { ref, computed,
watch
} from 'vue'
import Taro from '@tarojs/taro'
import { Search2, Check, Heart1, HeartFill } from '@nutui/icons-vue-taro'
import "./SearchPopup.less"
...
...
@@ -408,11 +408,19 @@ const resetSearchState = () => {
selectedSchool.value = '所在学校'
}
onMounted(() => {
// 动态修改标题
wx.setNavigationBarTitle({
title: '搜索车源'
});
// 监听visible.value的变化
watch(visible, (newVisible) => {
if (newVisible) {
// 动态修改标题
wx.setNavigationBarTitle({
title: '搜索车源'
});
} else {
// 关闭弹窗时重置标题
wx.setNavigationBarTitle({
title: ''
});
}
})
</script>
...
...
Please
register
or
login
to post a comment