vue中如何引用layui

1.把layui对应的包放在static文件夹下,所以就直接放在了static下

2.在index.html中直接引入layui.js和layui.css

3.在vue组件中的created勾子函数中写入如下代码

  created(){
    const _this = this;
    layui.use(['layer'],function(){
      _this.layer = layui.layer,
      this.layer.msg('hello');
    })
  }

原文地址:https://www.cnblogs.com/pwindy/p/13138292.html