vue 引入layui

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');
    })
  }
复制代码

 

 

 

转载自

 

 

posted @ 2021-07-02 14:42  ComeIntoBud  阅读(731)  评论(0)    收藏  举报