我已按照此处material-selected
的说明安装,方法是运行以下命令:
npm install @material/select
我已经包含了用于选择的 html 并设置了它的宽度。在我的sass
文件中,我导入了文档中建议的材质样式:
@use "@material/list/mdc-list";
@use "@material/menu-surface/mdc-menu-surface";
@use "@material/menu/mdc-menu";
@use "@material/select/mdc-select";
但是,当我尝试使用 parcel 构建项目时,出现错误:
Can't find stylesheet to import.
@use "@material/list/mdc-list";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/scss/app.scss 1:1 root stylesheet
我想如何导入这个样式表?我也尝试过使用波浪号运算符:
@use "~@material/list/mdc-list";
@use "~@material/menu-surface/mdc-menu-surface";
@use "~@material/menu/mdc-menu";
@use "~@material/select/mdc-select";
但是,这也没有帮助,然后我得到了::
@use "@material/density/functions" as density-functions;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
node_modules/@material/list/_mixins.scss 22:1 @use
node_modules/@material/list/mdc-list.scss 21:1 @use
src/scss/app.scss 1:1 root stylesheet
Error: Can't find stylesheet to import.
@use "@material/density/functions" as density-functions;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
node_modules/@material/list/_mixins.scss 22:1 @use
node_modules/@material/list/mdc-list.scss 21:1 @use
src/scss/app.scss 1:1 root stylesheet
同样在我的 vs 代码编辑器中,我收到 @use 是未知规则的警告:
Unknown at rule @usescss(unknownAtRules)
我不知道为什么会这样。