Vue introduces layui to report error

question: put css and js, of layui in static and also introduce these two css and js, in index.html. These two css and js, are also introduced in main.js using import, but writing layer.msg ("hello") in the mounted function in the build is an error report. The error report is as follows:

clipboard.png

index.html:

clipboard.png

main.js:

clipboard.png

swiperbanner.vue:

clipboard.png

what exactly is the problem? I"ve been looking for it all morning, but I really can"t find out why


the error message is very clear, layer is not defined. It is not possible for you to introduce layer.js before, to use layui.all.js,. In addition, you should not need to introduce layui, in both index.html and main.js. You only need to introduce layui, in index.html. Finally, although I haven't used layui, according to his documentation, this ui library should not be suitable for use with vue.

Menu