1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Improved with-ant-design example (#4034)

* Improved with-ant-design example

* standardjs fix maybe
This commit is contained in:
Luke Plaster 2018-03-23 19:52:34 +08:00 committed by Tim Neutkens
parent 9470b91ba1
commit a6af11c6ae
5 changed files with 20 additions and 11 deletions

View file

@ -6,7 +6,7 @@
"import",
{
"libraryName": "antd",
"style": false
"style": "css"
}
]
]

View file

@ -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='https://unpkg.com/antd@3/dist/antd.min.css' />
<link rel='stylesheet' href='/_next/static/style.css' />
</Head>
<style jsx global>{`
body {

View file

@ -0,0 +1,8 @@
const withCss = require('@zeit/next-css')
// fix: prevents error when .css files are required by node
if (typeof require !== 'undefined') {
require.extensions['.css'] = (file) => {}
}
module.exports = withCss()

View file

@ -7,7 +7,8 @@
"start": "next start"
},
"dependencies": {
"antd": "^3.0.2",
"@zeit/next-css": "^0.1.4",
"antd": "^3.3.1",
"babel-plugin-import": "^1.1.1",
"next": "latest",
"react": "^16.0.0",

View file

@ -12,7 +12,7 @@ export default () => (
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>
@ -21,7 +21,7 @@ export default () => (
label='Switch'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
>
<Switch defaultChecked name='switch' />
</FormItem>
@ -29,7 +29,7 @@ export default () => (
label='Slider'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
>
<Slider defaultValue={70} />
</FormItem>
@ -37,7 +37,7 @@ export default () => (
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>
@ -50,19 +50,19 @@ export default () => (
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>
<Button size='large' style={{ marginLeft: 8 }}>
Cancel
</Button>
</Button>
</FormItem>
</Form>
</div>