1

遵循 Ag-Grid vue ( https://www.ag-grid.com/vuejs-grid/#vue_theme_look )的指南时,我发生了一个错误

当我使用正常样式时,我没有问题。

错误:

Uncaught Error: Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):

    -webkit-font-smoothing: antialiased;
   ^
      Declarations may only be used within style rules.
   ╷
29 │     -webkit-font-smoothing: antialiased;
   │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  node_modules\ag-grid-community\src\styles\ag-theme-base\sass\_ag-theme-base-mixin.scss 29:5     ag-theme-base()
  node_modules\ag-grid-community\src\styles\ag-theme-alpine\sass\_ag-theme-alpine-mixin.scss 8:5  ag-theme-alpine()
  resources\sass\_aggrid.scss 4:1                                                                 @import
  stdin 12:9                                                                                      root stylesheet
      in C:\laragon\www\zonadolar\node_modules\ag-grid-community\src\styles\ag-theme-base\sass\_ag-theme-base-mixin.scss (line 29, column 5)
    at C:\laragon\www\zonadolar\node_modules\webpack\lib\NormalModule.js:316:20
    at C:\laragon\www\zonadolar\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\laragon\www\zonadolar\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\laragon\www\zonadolar\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\laragon\www\zonadolar\node_modules\sass-loader\dist\index.js:89:7
    at Function.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:88191:16)
    at _render_closure1.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:77610:12)
    at _RootZone.runBinary$3$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26152:18)
    at _RootZone.runBinary$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26156:19)
    at _FutureListener.handleError$1 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24600:19)
    at _Future__propagateToListeners_handleError.call$0 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24897:40)
    at Object._Future__propagateToListeners (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4311:88)
    at _Future._completeError$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24725:9)
    at _AsyncAwaitCompleter.completeError$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24117:12)
    at Object._asyncRethrow (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4065:17)
    at C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:14087:20
    at _wrapJsFunctionForAsync_closure.$protected (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4090:15)
    at _wrapJsFunctionForAsync_closure.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24138:12)
    at _awaitOnObject_closure0.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24130:25)
    at _RootZone.runBinary$3$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26152:18)
    at _RootZone.runBinary$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26156:19)
    at _FutureListener.handleError$1 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24600:19)
    at _Future__propagateToListeners_handleError.call$0 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24897:40)
    at Object._Future__propagateToListeners (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4311:88)
    at _Future._completeError$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24725:9)
    at _AsyncAwaitCompleter.completeError$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24117:12)
    at Object._asyncRethrow (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4065:17)
    at C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:16672:20
    at _wrapJsFunctionForAsync_closure.$protected (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4090:15)
    at _wrapJsFunctionForAsync_closure.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24138:12)
    at _awaitOnObject_closure0.call$2 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24130:25)
    at _RootZone.runBinary$3$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26152:18)
    at _RootZone.runBinary$3 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:26156:19)
    at _FutureListener.handleError$1 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24600:19)
    at _Future__propagateToListeners_handleError.call$0 (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:24897:40)
    at Object._Future__propagateToListeners (C:\laragon\www\zonadolar\node_modules\sass\sass.dart.js:4311:88)
    at Object../resources/sass/app.scss (http://zonadolar.test/js/app.js:81476:7)
    at __webpack_require__ (http://zonadolar.test/js/app.js:20:30)
    at Object.0 (http://zonadolar.test/js/app.js:81488:18)
    at __webpack_require__ (http://zonadolar.test/js/app.js:20:30)
    at http://zonadolar.test/js/app.js:84:18
    at http://zonadolar.test/js/app.js:87:10
./resources/sass/app.scss @ app.js:81476
__webpack_require__ @ app.js:20
0 @ app.js:81488
__webpack_require__ @ app.js:20
(anonymous) @ app.js:84
(anonymous) @ app.js:87

资源/sass/_aggrid.scss

@import "../../node_modules/ag-grid-community/src/styles/ag-grid.scss";
@import "../../node_modules/ag-grid-community/src/styles/ag-theme-alpine/sass/ag-theme-alpine-mixin.scss";

@include ag-theme-alpine((
    add-row-background-color: #ACE
));

显然在评论@include时错误消失了

  • 拉拉维尔 6
  • 带有 Laragon 的 Windows 10(本地)
4

1 回答 1

0

已经解决了。
显然文档是错误的。
这不是add-row-background-color: #ACE应该的odd-row-background-color: #ACE

于 2020-09-01T21:17:32.087 回答