mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
底部导航栏修复
This commit is contained in:
parent
6cdb658231
commit
597ef2c455
@ -391,7 +391,8 @@ export class App extends React.PureComponent {
|
|||||||
setHeaderVisible: this.setHeaderVisible,
|
setHeaderVisible: this.setHeaderVisible,
|
||||||
theme: theme.value,
|
theme: theme.value,
|
||||||
classPrefix: theme.ns,
|
classPrefix: theme.ns,
|
||||||
locale: this.state.locale
|
locale: this.state.locale,
|
||||||
|
ContextPath
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
@ -996,7 +996,9 @@ export default class Doc extends React.PureComponent {
|
|||||||
: null
|
: null
|
||||||
}));
|
}));
|
||||||
const flattenDocs = flattenTree(newDocs).filter(i => !!i.path);
|
const flattenDocs = flattenTree(newDocs).filter(i => !!i.path);
|
||||||
const docIndex = flattenDocs.findIndex(d => d.path === location.pathname);
|
const docIndex = flattenDocs.findIndex(
|
||||||
|
d => `${this.props.ContextPath}${d.path}` === location.pathname
|
||||||
|
);
|
||||||
this.setState({
|
this.setState({
|
||||||
prevDoc: flattenDocs[docIndex - 1],
|
prevDoc: flattenDocs[docIndex - 1],
|
||||||
nextDoc: flattenDocs[docIndex + 1]
|
nextDoc: flattenDocs[docIndex + 1]
|
||||||
@ -1011,6 +1013,7 @@ export default class Doc extends React.PureComponent {
|
|||||||
theme: this.props.theme,
|
theme: this.props.theme,
|
||||||
classPrefix: this.props.classPrefix,
|
classPrefix: this.props.classPrefix,
|
||||||
locale: this.props.locale,
|
locale: this.props.locale,
|
||||||
|
ContextPath: this.props.ContextPath,
|
||||||
prevDoc: this.state.prevDoc,
|
prevDoc: this.state.prevDoc,
|
||||||
nextDoc: this.state.nextDoc
|
nextDoc: this.state.nextDoc
|
||||||
})}
|
})}
|
||||||
|
@ -12,12 +12,6 @@ import {Portal} from 'react-overlays';
|
|||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import {Link} from 'react-router';
|
import {Link} from 'react-router';
|
||||||
|
|
||||||
let ContextPath = '';
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
|
||||||
ContextPath = '/amis';
|
|
||||||
}
|
|
||||||
|
|
||||||
class CodePreview extends React.Component {
|
class CodePreview extends React.Component {
|
||||||
state = {
|
state = {
|
||||||
PlayGround: null
|
PlayGround: null
|
||||||
@ -190,7 +184,7 @@ export default function (doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {prevDoc, nextDoc} = this.props;
|
const {prevDoc, nextDoc, ContextPath} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user