我尝试用新的主题混合器为Ag生成一个自定义主题。但我总是会遇到以下错误:
ERROR in ./src/app/style.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--15-3!./src/app/style.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
undefined
^
Ag-param() called before ag-register-params
in C:\Development\WebApp\node_modules\@ag-grid-enterprise\all-modules\dist\styles\mixins\_ag-theme-params.scss (line 191, column 16)风格:
@import "../../../../node_modules/@ag-grid-enterprise/all-modules/dist/styles/ag-grid.scss";
@import "../../../../node_modules/@ag-grid-enterprise/all-modules/dist/styles/ag-theme-material/sass/ag-theme-material-mixin";
.ag-theme-custom-test {
@include ag-theme-material();
}发布于 2021-03-18 07:17:03
我已经找到了解决问题的办法。主题的生成必须在应用程序的加载中完成。我已经将我的Ag主题外包到另一个文件中,该文件将被导入。
旧的外包主题文件:
@import '~@ag-grid-enterprise/all-modules/dist/styles/ag-grid.scss';
@import '~@ag-grid-enterprise/all-modules/dist/styles/ag-theme-material/sass/_ag-theme-material-mixin.scss';
.ag-theme-material{
@include ag-theme-material(
(
background-color: green
)
);
}旧styles.scss(最初加载->参见angular.json配置)
.dark-theme {
@import './outsourced-ag-grid-theme.scss' // not working
REST OF THE OTHER THEMING STUFF....
}新的外包主题文件:
@import '~@ag-grid-enterprise/all-modules/dist/styles/ag-grid.scss';
@import '~@ag-grid-enterprise/all-modules/dist/styles/ag-theme-material/sass/_ag-theme-material-mixin.scss';
.dark-theme .ag-theme-material{
@include ag-theme-material(
(
background-color: green
)
);
}新styles.scss(最初加载->参见angular.json配置)
.dark-theme {
REST OF THE OTHER THEMING STUFF....
}
@import './outsourced-ag-grid-theme.scss' // place it outside and it will be initially load我希望我能帮助其他的神职人员。如果你有问题就告诉我。
https://stackoverflow.com/questions/64446197
复制相似问题