我想做的是导航到特定的部分,在着陆页时,用户直接访问它的URL,即(localhost:3000/常见问题解答)
我尝试使用了许多解决方案:但它总是重定向到404页面
import DefaultLayout from "@Components/DefaultLayout";
import {
JoinCommunity,
LandingBanner,
MixMatch,
OnlinePresence,
LandingFaqs,
} from "@Components/LandingPage";
import { NextPage } from "next";
import { RIA } from "@Constants/acl";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import withGuard from "@Hocs/withGuard";
import { SocialProfileJsonLd } from "next-seo";
import { generatePageSeo, getFullURL } from "@Utils/Seo";
interface Props {
ACL: {
action: string;
};
}
const LandingPage: NextPage<Props> = () => {
const { locale, asPath } = useRouter();
const { t } = useTranslation("common");
const completeURL = getFullURL(asPath, locale);
return (
<DefaultLayout
showFooter
showLandingNav
fullWidth
>
<LandingBanner />
<OnlinePresence />
<MixMatch />
<JoinCommunity />
<LandingFaqs />
</DefaultLayout>
);
};
LandingPage.getInitialProps = async () => {
return {
ACL: {
action: RIA,
},
};
};
export default withGuard(LandingPage);
所以我想知道有没有办法做到这一点
1条答案
按热度按时间djp7away1#
经过思考我的问题,我认为我是过度工程的解决方案,所以我做了什么我创建了另一个页面称为faqs下的页面目录和它的内容是相同的着陆页和执行滚动行为