底部跳转链接修复

This commit is contained in:
RickCole21 2020-07-31 13:07:34 +08:00
parent ac7e2e7551
commit 3a0ad1cd33

View File

@ -12,6 +12,12 @@ 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
@ -200,7 +206,10 @@ export default function (doc) {
<div className="Doc-footer"> <div className="Doc-footer">
<div className="Doc-navLinks"> <div className="Doc-navLinks">
{prevDoc ? ( {prevDoc ? (
<Link className="Doc-navLinks--prev" to={prevDoc.path}> <Link
className="Doc-navLinks--prev"
to={`${ContextPath}${prevDoc.path}`}
>
<div className="Doc-navLinks-icon"> <div className="Doc-navLinks-icon">
<i className="iconfont icon-arrow-left"></i> <i className="iconfont icon-arrow-left"></i>
</div> </div>
@ -215,7 +224,10 @@ export default function (doc) {
) : null} ) : null}
{nextDoc ? ( {nextDoc ? (
<Link className="Doc-navLinks--next" to={nextDoc.path}> <Link
className="Doc-navLinks--next"
to={`${ContextPath}${nextDoc.path}`}
>
<div className="Doc-navLinks-body"> <div className="Doc-navLinks-body">
<div className="Doc-navLinks-subtitle"> <div className="Doc-navLinks-subtitle">
- {nextDoc.group || '其他'} - {nextDoc.group || '其他'}