First to a project directory structure;
The first step download layui
npm i layui-src
In this case there is a folder node_modules layui-src below;
The second step is introduced, the introduction of css in main.js, this time css success; however js introduced here will complain unsuccessful, so the js elsewhere introduction (a successful tell me ha)
The third step is the introduction of js
The node_modules following layui-src folder to the public the following, with the same level index.html
Edit then introduced index.html <script src = "./ layui-src / dist / layui.js"> </ script>
The fourth step directly