Skip to content

Commit

Permalink
chore(demo): update list demo in both react and vue
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Oct 14, 2024
1 parent 6147b0d commit b4d30a4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
View,
StyleSheet,
Text,
Platform,
} from '@hippy/react';

const STYLE_LOADING = 100;
Expand Down Expand Up @@ -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}
Expand All @@ -297,33 +295,32 @@ export default class ListExample extends React.Component {
onScroll={this.onScroll}
scrollEventThrottle={1000} // 1s
/>
{Platform.OS === 'android'
? <View
onClick={() => 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' }}>
<View style={{
width: 60,
height: 60,
borderRadius: 30,
backgroundColor: '#4c9afa',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}>
<View
onClick={() => 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' }}>
<View style={{
width: 60,
height: 60,
borderRadius: 30,
backgroundColor: '#4c9afa',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}>
<Text style={{ color: 'white' }}>切换方向</Text>
</View>
</View> : null}
</View>
</View>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
</li>
</ul>
<div
v-if="Vue.Native.Platform === 'android'"
:style="{
position: 'absolute',
right: 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
</li>
</ul>
<div
v-if="Platform === 'android'"
:style="{
position: 'absolute',
right: 20,
Expand Down Expand Up @@ -114,7 +113,7 @@
</template>

<script lang="ts">
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;
Expand Down Expand Up @@ -269,7 +268,6 @@ export default defineComponent({
list,
STYLE_LOADING,
horizontal,
Platform: Native.Platform,
onAppear,
onDelete,
onDisappear,
Expand Down

0 comments on commit b4d30a4

Please sign in to comment.