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

vue中如何引用layui

 

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

vue中如何引用layui

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

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

 

vue中如何引用layui

 

相关文章:

  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-01-15
  • 2021-05-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案