Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
manulife-weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2026-02-06 21:29:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a11d958e17b31a4a79f3cc919d143f930cb2090b
a11d958e
1 parent
3f7157fc
fix(plan): 修复搜索栏清空按钮点击无效
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
docs/CHANGELOG.md
src/components/SearchBar.vue
src/pages/plan/index.vue
docs/CHANGELOG.md
View file @
a11d958
...
...
@@ -5,6 +5,21 @@
---
## [2026-02-06] - 修复搜索栏清空按钮点击无效
### 修复
-
修复计划书页面搜索框清空按钮点击无响应的问题
-
SearchBar 组件添加
`.stop`
修饰符阻止事件冒泡
-
增强
`handleClear`
函数,显式调用
`stopPropagation()`
-
添加
`emit('input', '')`
保持事件一致性
-
计划书页面添加显式
`searchValue`
重置
---
> 格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
---
## [2026-02-06] - 修复计划书页面触底加载更多不触发
### 修复
...
...
src/components/SearchBar.vue
View file @
a11d958
...
...
@@ -27,7 +27,8 @@
<view
v-if="showClear && internalValue"
class="clear-icon"
@tap="handleClear"
@tap.stop="handleClear"
@click.stop="handleClear"
>
<IconFont
name="close"
...
...
@@ -236,11 +237,20 @@ function handleSearch() {
/**
* 清除输入
*/
function handleClear() {
function handleClear(
event
) {
console.log('[SearchBar Component] 清除输入')
// 阻止事件冒泡
if (event) {
event.stopPropagation()
}
// 清空内部值
internalValue.value = ''
// 触发 clear 事件(通知父组件)
emit('clear')
// 触发 v-model 更新
emit('update:modelValue', '')
// 触发 input 事件(保持一致性)
emit('input', '')
}
/**
...
...
src/pages/plan/index.vue
View file @
a11d958
...
...
@@ -596,6 +596,11 @@ const onSearch = () => {
* 清空搜索
*/
const onClear = () => {
console.log('[Plan Page] onClear 被调用')
// 清空搜索值
searchValue.value = ''
// 重置分页状态
currentPage.value = 0
hasMore.value = true
...
...
@@ -604,6 +609,8 @@ const onClear = () => {
// 重新加载数据
fetchPlanList(0, pageSize, false)
console.log('[Plan Page] onClear 完成,列表已刷新')
}
/**
...
...
Please
register
or
login
to post a comment