小编Usa*_*zaq的帖子

在同一个项目中使用 Material Ui 和 Tailwind 是一个好习惯吗

我正在将 next.js 与 tailwind css 一起使用,并且我在项目中需要一些现成的组件,这样我就可以节省时间,因为我使用了 Material-ui。我的应用程序工作正常,但我收到一条警告消息。如果“是”(意味着如果两者的组合不会影响项目的性能或将来的任何其他问题),是否可以在同一个项目中使用这两种技术(material-ui 和 tailwind css)?删除下面显示的警告消息 在此输入图像描述

material-ui next.js tailwind-css

15
推荐指数
1
解决办法
2万
查看次数

安装依赖项时如何解决“'websocket-driver'完整性检查失败”错误?

我尝试将 Next.js 应用程序上传到 Vercel,但在部署期间 Vercel 抛出了一条错误消息。

在此输入图像描述

然后我尝试重新安装我的纱线包,但安装没有完成,我的命令终端抛出了关于 websocket 的相同错误。

在此输入图像描述

如何解决该错误?

websocket yarnpkg next.js

13
推荐指数
1
解决办法
7352
查看次数

tailwind css 在 nextjs 中无法正常工作

我正在 Next.js 中使用 tailwind,并使用以下命令创建环境:npx create-next-app --example with-tailwindcss with-tailwindcss-app

除了一件事之外,一切都正常

  • 我在<span/>标签上使用断点,如果我使用除默认(xs)之外的所有断点,那么我的设计工作正常,但如果将默认断点与其他断点一起使用,则默认/xs适用于所有其他断点。
 <span className=" text-xl text-red-500  sm:text-blue-500 md:text-indigo-500 lg:text-violet-500 font-semibold  "> Hy, I am </span>
Run Code Online (Sandbox Code Playgroud)

在我的代码中text-red-500适用于每个断点

我知道我的语法是正确的,但不知何故在加载 CSS 文件时出现问题,并且我不知道应该定位哪些文件。

大家的意见都可以接受

我还附上了我的项目中的一些文件。

tailwind.config包.json全局.css应用程序.js

next.js tailwind-css

5
推荐指数
1
解决办法
8620
查看次数

如何将 Tailwind CSS 滚动平滑类添加到 Next.js

我想向我的 Next.js 应用程序添加平滑的滚动行为,Tailwind CSS 文档指示我们在<html/>.

    <html class="scroll-smooth ">
      <!-- ... -->
    </html>
Run Code Online (Sandbox Code Playgroud)

该文件不包含html标签:

  import Head from "next/head";
  import "@material-tailwind/react/tailwind.css";
  import "../styles/globals.css";
 
    function MyApp({ Component, pageProps }) {
      return (
        <>
          <Head>
            <link
              href="https://fonts.googleapis.com/icon?family=Material+Icons"
              rel="stylesheet"
            />
          </Head>
    
            <Component {...pageProps} />
    
        </>
      );
    }
    
    export default MyApp;
Run Code Online (Sandbox Code Playgroud)

如何以及在哪里可以smooth-scroll在我的项目中添加实用程序类?

next.js tailwind-css

5
推荐指数
2
解决办法
1万
查看次数

Candidate.toLowerCase 不是函数。(在“candidate.toLowerCase()”中,“candidate.toLowerCase”未定义)Material UI

我正在使用AutoComplete APIMaterial UI。有一个top100Films对象,其中包含电影的标题和年份。如果我top100Film.title按照代码中所示进行搜索,我的自动完成功能可以正常工作

<Autocomplete
  id="combo-box-demo"
  options={top100Films}
  getOptionLabel={(option) => option.title} // <--
  style={{ width: 300 }}
  renderInput={(params) => <TextField {...params} label="Combo box" variant="outlined" />}
/>
Run Code Online (Sandbox Code Playgroud)

但如果我想搜索电影,top100Films.year那么我会收到一条错误消息

<Autocomplete
  id="combo-box-demo"
  options={top100Films}
  getOptionLabel={(option) => option.year}//<--
  style={{ width: 300 }}
  renderInput={(params) => <TextField {...params} label="Combo box" variant="outlined" />}
/>
Run Code Online (Sandbox Code Playgroud)

Candidate.toLowerCase 不是函数。(在“candidate.toLowerCase()”中,“candidate.toLowerCase”未定义)

我如何使用除.title

代码在链接中

reactjs material-ui

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