-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61233b0
commit 64e73bd
Showing
7 changed files
with
317 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,163 @@ | ||
import './style' | ||
import React from 'react' | ||
|
||
class A extends React.Component { | ||
import { Layout, Popup, Cell } from 'auto-ui' | ||
|
||
class DemoLayout extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = { | ||
default: false, | ||
highest: false, | ||
Loading: false, | ||
errorInfo: false, | ||
hideFooter: false | ||
} | ||
} | ||
render() { | ||
return <h1>a</h1> | ||
return ( | ||
<React.Fragment> | ||
<Cell> | ||
<Cell.Row | ||
onClick={() => { | ||
this.setState({ | ||
default: true | ||
}) | ||
}} | ||
> | ||
基本使用 | ||
</Cell.Row> | ||
<Cell.Row | ||
onClick={() => { | ||
this.setState({ | ||
highest: true | ||
}) | ||
}} | ||
> | ||
高级导航 | ||
</Cell.Row> | ||
<Cell.Row | ||
onClick={() => { | ||
this.setState({ | ||
Loading: true | ||
}) | ||
}} | ||
> | ||
Loading | ||
</Cell.Row> | ||
<Cell.Row | ||
onClick={() => { | ||
this.setState({ | ||
errorInfo: true | ||
}) | ||
}} | ||
> | ||
错误处理 | ||
</Cell.Row> | ||
<Cell.Row | ||
onClick={() => { | ||
this.setState({ | ||
hideFooter: true | ||
}) | ||
}} | ||
> | ||
不显示底部 | ||
</Cell.Row> | ||
</Cell> | ||
<Popup | ||
onBgClick={() => { | ||
this.setState({ | ||
default: false | ||
}) | ||
}} | ||
visible={this.state.default} | ||
> | ||
<Layout> | ||
<Layout.Header>header</Layout.Header> | ||
|
||
<Layout.Body>body</Layout.Body> | ||
|
||
<Layout.Footer>footer</Layout.Footer> | ||
</Layout> | ||
</Popup> | ||
|
||
<Popup | ||
onBgClick={() => { | ||
this.setState({ | ||
highest: false | ||
}) | ||
}} | ||
visible={this.state.highest} | ||
> | ||
<Layout> | ||
<Layout.Header | ||
addonBefore={<a href="#">左侧挂载</a>} | ||
title="标题" | ||
onBackClick={() => {}} | ||
onCloseClick={() => {}} | ||
addonAfter={<a href="#">右侧挂载</a>} | ||
addonBottom={<p>下方挂载</p>} | ||
/> | ||
|
||
<Layout.Body>body</Layout.Body> | ||
|
||
<Layout.Footer>footer</Layout.Footer> | ||
</Layout> | ||
</Popup> | ||
|
||
<Popup | ||
onBgClick={() => { | ||
this.setState({ | ||
Loading: false | ||
}) | ||
}} | ||
visible={this.state.Loading} | ||
> | ||
<Layout> | ||
<Layout.Header>header</Layout.Header> | ||
|
||
<Layout.Body loading>body</Layout.Body> | ||
|
||
<Layout.Footer>footer</Layout.Footer> | ||
</Layout> | ||
</Popup> | ||
|
||
<Popup | ||
onBgClick={() => { | ||
this.setState({ | ||
errorInfo: false | ||
}) | ||
}} | ||
visible={this.state.errorInfo} | ||
> | ||
<Layout> | ||
<Layout.Header>header</Layout.Header> | ||
|
||
<Layout.Body errorInfo="我是错误消息">body</Layout.Body> | ||
|
||
<Layout.Footer>footer</Layout.Footer> | ||
</Layout> | ||
</Popup> | ||
|
||
<Popup | ||
onBgClick={() => { | ||
this.setState({ | ||
hideFooter: false | ||
}) | ||
}} | ||
visible={this.state.hideFooter} | ||
> | ||
<Layout> | ||
<Layout.Header>header</Layout.Header> | ||
|
||
<Layout.Body>body</Layout.Body> | ||
|
||
<Layout.Footer visible={false}>footer</Layout.Footer> | ||
</Layout> | ||
</Popup> | ||
</React.Fragment> | ||
) | ||
} | ||
} | ||
|
||
export default A | ||
export default DemoLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.x-popup__inner { | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.