Skip to content

Commit

Permalink
feat(vue): support ul refresh scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotchen0 committed Sep 13, 2024
1 parent c9dd227 commit 8ed8389
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions driver/js/packages/hippy-vue-native-components/src/ul-refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ function registerUlRefresh(Vue: any) {
Vue.registerElement('hi-ul-refresh-wrapper', {
component: {
name: 'RefreshWrapper',
processEventData(event, nativeEventName, nativeEventParams) {
switch (nativeEventName) {
case 'onScroll': {
event.offsetX = nativeEventParams.contentOffset.x;

Check warning on line 30 in driver/js/packages/hippy-vue-native-components/src/ul-refresh.ts

View workflow job for this annotation

GitHub Actions / frontend_build_tests (16.x)

Assignment to property of function parameter 'event'

Check warning on line 30 in driver/js/packages/hippy-vue-native-components/src/ul-refresh.ts

View workflow job for this annotation

GitHub Actions / frontend_build_tests (17.x)

Assignment to property of function parameter 'event'
event.offsetY = nativeEventParams.contentOffset.y;

Check warning on line 31 in driver/js/packages/hippy-vue-native-components/src/ul-refresh.ts

View workflow job for this annotation

GitHub Actions / frontend_build_tests (16.x)

Assignment to property of function parameter 'event'

Check warning on line 31 in driver/js/packages/hippy-vue-native-components/src/ul-refresh.ts

View workflow job for this annotation

GitHub Actions / frontend_build_tests (17.x)

Assignment to property of function parameter 'event'
break;
}
default:
}
return event;
},
},
});

Expand Down Expand Up @@ -53,6 +64,7 @@ function registerUlRefresh(Vue: any) {
render(h: any) {
const on = getEventRedirector.call(this, [
'refresh',
'scroll',
]);
return h('hi-ul-refresh-wrapper', {
on,
Expand Down

0 comments on commit 8ed8389

Please sign in to comment.