FastAdmin Integrate Layui
Method 1: Global import
Download full repo (dist + src) from:
https://gitee.com/layui/layui
Place it into:public/libs/layui
Add to public/assets/js/require-backend.js
:
require.config({ |
Target page usage:
define(["jquery", "bootstrap", "backend", "form", "table", "layui"], function ($, undefined, Backend, Form, Table, layui) { |
Pack/minify before use (then clear browser cache):
php think min -m all -r all |
Method 2: Dynamic import
In public/assets/js/backend-init.js
:
define(['backend'], function (Backend) { |
Target page usage with dynamic load:
define(["jquery", "bootstrap", "backend", "form", "table", "layui"], function ($, undefined, Backend, Form, Table, layui) { |
Pack again when done:
php think min -m all -r all |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments