小编Uri*_*iro的帖子

Tailwind 的指令 @apply 不适用于 Nuxt

我正在尝试在我的全新项目中使用 Tailwind,每个实用程序都可以正常工作,但 @apply 甚至无法编译。

这是错误消息:

Syntax Error: SyntaxError                                                                                                                                                                                                                                       friendly-errors 08:12:30

(5:5) `@apply` cannot be used with `.lg\:mt-0` because `.lg\:mt-0` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.lg\:mt-0` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.

  3 | @import 'tailwindcss/components';
  4 | .navbar-item-link {
> 5 | …
Run Code Online (Sandbox Code Playgroud)

css nuxt.js tailwind-css

3
推荐指数
1
解决办法
2887
查看次数

标签 统计

css ×1

nuxt.js ×1

tailwind-css ×1