Skip to content

Commit

Permalink
feat(Stepper): Add Stepper component. (#179)
Browse files Browse the repository at this point in the history
* 添加React Native组件

* 添加React Native组件

* 添加React Native组件

* 添加 Stepper 步进器组件

* 删除样式文件
  • Loading branch information
hy916 committed Aug 15, 2021
1 parent 1262d65 commit e3d8b78
Show file tree
Hide file tree
Showing 9 changed files with 743 additions and 0 deletions.
8 changes: 8 additions & 0 deletions example/examples/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@ export const stackPageData: Routes[] = [
description: '通告栏',
},
},
{
name: 'Stepper',
component: require('./routes/Stepper').default,
params: {
title: 'Stepper 步进器',
description: 'Stepper 步进器 用作增加或者减少当前数值。',
},
},
{
name: 'SpeedDial',
component: require('./routes/SpeedDial').default,
Expand Down
63 changes: 63 additions & 0 deletions example/examples/src/routes/Stepper/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* tslint:disable:no-console */
import React from 'react'
import { View } from 'react-native'
import {List, Stepper} from '@uiw/react-native';
import Layout from '../../Layout';
const {Header} = Layout;

function onChange(value: any) {
console.log('changed', value)
}

export default class StepperExample extends React.Component<any, any> {

render() {
const {route} = this.props;
const description = route.params.description;
const title = route.params.title;

const readOnly = (
<Stepper
key="1"
max={999}
min={1}
readOnly={false}
defaultValue={888}
onChange={onChange}
/>
)
return (
<View style={{ flex:1 }}>
<Header title={title} description={description} />
<List>
<List.Item
extra={
<Stepper
key="0"
max={9999}
min={0}
defaultValue={3}
onChange={onChange}
/>
}>
请选择您要购买iPhone 12 的数量:
</List.Item>
<List.Item extra={readOnly}>您当前选择的数量为: </List.Item>
<List.Item
extra={
<Stepper
key="2"
disabled
max={100}
min={0}
defaultValue={0}
onChange={onChange}
/>
}>
暂无库存:
</List.Item>
</List>
</View>
)
}
}
Loading

0 comments on commit e3d8b78

Please sign in to comment.