Home >Web Front-end >Vue.js >How to use layui in vue

How to use layui in vue

coldplay.xixi
coldplay.xixiOriginal
2020-12-17 14:47:315564browse

How to use layui in vue: first put the package corresponding to layui in the static folder; then directly introduce [layui.js] and [layui.css] in [index.html]; finally Write relevant code in the created hook function in the vue component.

How to use layui in vue

The operating environment of this tutorial: windows7 system, Vue2.9.6&&layui2.5.4 version. This method is suitable for all brands of computers.

[Related article recommendations: vue.js]

How to use layui in vue:

1. Put the package corresponding to layui under the static folder, so put it directly under static

How to use layui in vue

2. Directly introduce layui.js and layui.css

How to use layui in vue

3. Write the following code in the created hook function in the vue component

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

How to use layui in vue

Related free learning recommendations: javascript learning tutorial

The above is the detailed content of How to use layui in vue. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn