mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Update Ant Design example (#3485)
This commit is contained in:
parent
57a0fc432c
commit
9263ad13f7
|
@ -4,7 +4,7 @@ export default ({ children }) =>
|
|||
<Head>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
||||
<meta charSet='utf-8' />
|
||||
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/antd/2.9.3/antd.min.css' />
|
||||
<link rel='stylesheet' href='https://unpkg.com/antd@3/dist/antd.min.css' />
|
||||
</Head>
|
||||
<style jsx global>{`
|
||||
body {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"antd": "^2.10.2",
|
||||
"antd": "^3.0.2",
|
||||
"babel-plugin-import": "^1.1.1",
|
||||
"next": "latest",
|
||||
"react": "^16.0.0",
|
||||
|
|
|
@ -1,73 +1,70 @@
|
|||
import Layout from '../index.js'
|
||||
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button, LocaleProvider } from 'antd'
|
||||
import enUS from 'antd/lib/locale-provider/en_US'
|
||||
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button } from 'antd'
|
||||
|
||||
const FormItem = Form.Item
|
||||
const Option = Select.Option
|
||||
|
||||
export default () => (
|
||||
<Layout>
|
||||
<LocaleProvider locale={enUS}>
|
||||
<div style={{ marginTop: 100 }}>
|
||||
<Form layout='horizontal'>
|
||||
<FormItem
|
||||
label='Input Number'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<InputNumber size='large' min={1} max={10} style={{ width: 100 }} defaultValue={3} name='inputNumber' />
|
||||
<a href='#'>Link</a>
|
||||
</FormItem>
|
||||
<div style={{ marginTop: 100 }}>
|
||||
<Form layout='horizontal'>
|
||||
<FormItem
|
||||
label='Input Number'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<InputNumber size='large' min={1} max={10} style={{ width: 100 }} defaultValue={3} name='inputNumber' />
|
||||
<a href='#'>Link</a>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label='Switch'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Switch defaultChecked name='switch' />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label='Switch'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Switch defaultChecked name='switch' />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label='Slider'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Slider defaultValue={70} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label='Slider'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Slider defaultValue={70} />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label='Select'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Select size='large' defaultValue='lucy' style={{ width: 192 }} name='select'>
|
||||
<Option value='jack'>jack</Option>
|
||||
<Option value='lucy'>lucy</Option>
|
||||
<Option value='disabled' disabled>disabled</Option>
|
||||
<Option value='yiminghe'>yiminghe</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label='Select'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<Select size='large' defaultValue='lucy' style={{ width: 192 }} name='select'>
|
||||
<Option value='jack'>jack</Option>
|
||||
<Option value='lucy'>lucy</Option>
|
||||
<Option value='disabled' disabled>disabled</Option>
|
||||
<Option value='yiminghe'>yiminghe</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label='DatePicker'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<DatePicker name='startDate' />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
style={{ marginTop: 48 }}
|
||||
wrapperCol={{ span: 8, offset: 8 }}
|
||||
>
|
||||
<Button size='large' type='primary' htmlType='submit'>
|
||||
OK
|
||||
</Button>
|
||||
<Button size='large' style={{ marginLeft: 8 }}>
|
||||
Cancel
|
||||
</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
</LocaleProvider>
|
||||
<FormItem
|
||||
label='DatePicker'
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 8 }}
|
||||
>
|
||||
<DatePicker name='startDate' />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
style={{ marginTop: 48 }}
|
||||
wrapperCol={{ span: 8, offset: 8 }}
|
||||
>
|
||||
<Button size='large' type='primary' htmlType='submit'>
|
||||
OK
|
||||
</Button>
|
||||
<Button size='large' style={{ marginLeft: 8 }}>
|
||||
Cancel
|
||||
</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue