From b4d30a4cc65dfedf932bbdc7c83d56f5801a7246 Mon Sep 17 00:00:00 2001 From: wwwcg Date: Mon, 14 Oct 2024 20:25:18 +0800 Subject: [PATCH] chore(demo): update list demo in both react and vue --- .../src/components/ListView/index.jsx | 53 +++++++++---------- .../src/components/demos/demo-list.vue | 1 - .../src/components/demo/demo-list.vue | 4 +- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/driver/js/examples/hippy-react-demo/src/components/ListView/index.jsx b/driver/js/examples/hippy-react-demo/src/components/ListView/index.jsx index eb57411f47b..6c50de00f2e 100644 --- a/driver/js/examples/hippy-react-demo/src/components/ListView/index.jsx +++ b/driver/js/examples/hippy-react-demo/src/components/ListView/index.jsx @@ -4,7 +4,6 @@ import { View, StyleSheet, Text, - Platform, } from '@hippy/react'; const STYLE_LOADING = 100; @@ -271,8 +270,7 @@ export default class ListExample extends React.Component { return true; }} bounces={true} - // horizontal ListView flag(only Android support) - horizontal={horizontal} + horizontal={horizontal} // horizontal ListView flag style={[{ backgroundColor: '#ffffff' }, horizontal ? { height: 50 } : { flex: 1 }]} numberOfRows={dataSource.length} renderRow={this.getRenderRow} @@ -297,33 +295,32 @@ export default class ListExample extends React.Component { onScroll={this.onScroll} scrollEventThrottle={1000} // 1s /> - {Platform.OS === 'android' - ? this.changeDirection()} - style={{ - position: 'absolute', - right: 20, - bottom: 20, - width: 67, - height: 67, - borderRadius: 30, - boxShadowOpacity: 0.6, - boxShadowRadius: 5, - boxShadowOffsetX: 3, - boxShadowOffsetY: 3, - boxShadowColor: '#4c9afa' }}> - + this.changeDirection()} + style={{ + position: 'absolute', + right: 20, + bottom: 20, + width: 67, + height: 67, + borderRadius: 30, + boxShadowOpacity: 0.6, + boxShadowRadius: 5, + boxShadowOffsetX: 3, + boxShadowOffsetY: 3, + boxShadowColor: '#4c9afa' }}> + 切换方向 - : null} + ); } diff --git a/driver/js/examples/hippy-vue-demo/src/components/demos/demo-list.vue b/driver/js/examples/hippy-vue-demo/src/components/demos/demo-list.vue index 853bda36ee8..24d2a913cb2 100644 --- a/driver/js/examples/hippy-vue-demo/src/components/demos/demo-list.vue +++ b/driver/js/examples/hippy-vue-demo/src/components/demos/demo-list.vue @@ -78,7 +78,6 @@
-import { type ListViewEvent, Native } from '@hippy/vue-next'; +import { type ListViewEvent } from '@hippy/vue-next'; import { defineComponent, ref, onMounted, type Ref } from '@vue/runtime-core'; const STYLE_LOADING = 100; @@ -269,7 +268,6 @@ export default defineComponent({ list, STYLE_LOADING, horizontal, - Platform: Native.Platform, onAppear, onDelete, onDisappear,