这些是我遵循的步骤:
-
npm install material-components-web
- 在我的“ resources / sass / app.scss”中,我使用此代码
@import '~material-components-web/material-components-web
导入了它; - 在我的“ resources / js / app.js”中,我添加了此代码
window.mdc = require("material-components-web/dist/material-components-web"); window.mdc.autoInit();
- 然后我运行
npm run watch
; - 然后我得到这个错误:
ERROR Failed to compile with 2 errors 2:52:28 PM
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
ModuleBuildError: Module build failed (from ./node_modules/resolve-url-loader/index.js):
Error: file://C:\wamp64\www\enstoa\resources\sass\app.scss:37:5896: missing '{'
at error (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:62:15)
at declarations (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:248:25)
at rule (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:561:21)
at rules (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:118:70)
at stylesheet (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:81:21)
at module.exports (C:\wamp64\www\enstoa\node_modules\css\lib\parse\index.js:565:20)
at rework (C:\wamp64\www\enstoa\node_modules\rework\index.js:27:21)
at process (C:\wamp64\www\enstoa\node_modules\resolve-url-loader\lib\engine\rework.js:34:18)
我需要有关如何在Laravel中成功集成Material Design的帮助。我是MDC的新手。