小编ric*_*k2k的帖子

使用 nextjs 正确链接 Bootstrap 导航栏

嘿,我花了几个小时努力用 Nextjs 设置一个基本的 Bootstrap 导航栏。

而且我还认为我还有其他问题而不是显示的错误消息。

也请让我知道如何使整体变得更好!我应该使用 _app.js 而不是 Layout 吗?

页面/index.js

import Layout from "../components/Layout";

class Page extends React.Component {
  render() {
    return (
      <Layout>
        <div className="container">
          <div className="starter text-center">
            <h1>Bootstrap starter template</h1>
            <p className="lead">
              Use this document as a way to quickly start any new project.
              <br /> All you get is this text and a mostly barebones HTML
              document.
            </p>
          </div>
        </div>
      </Layout>
    );
  }
}

export default Page;

Run Code Online (Sandbox Code Playgroud)

关于页面看起来几乎一样

组件/Header.js

import Link from "next/link";

class Header …
Run Code Online (Sandbox Code Playgroud)

reactjs bootstrap-4 next.js

4
推荐指数
1
解决办法
6119
查看次数

标签 统计

bootstrap-4 ×1

next.js ×1

reactjs ×1