Introducing layui into fastadmin and invoking layui interfaces
First Method: Global Introduction
First, go to the layui official website, download the entire repository, which includes the dist and src directories.
Place the downloaded layui in the following directory:
public/libs/layui
In the following file, add layui to paths and shim respectively:
public/assets/js/require-backend.js
require.config({ |
Calling in Target Page JS
define(["jquery", "bootstrap", "backend", "form", "table", "layui"], function ( |
To compress and package both front-end and back-end JS and CSS in one go, execute the following command in the root directory and then refresh the browser after clearing the cache for the changes to take effect:
php think min -m all -r all |
Second Method: Dynamic Introduction
First, define dependency configuration in public/assets/js/backend-init.js
define(['backend'], function (Backend) { |
Calling in Target Page JS
define(["jquery", "bootstrap", "backend", "form", "table", "layui"], function ( |
To compress and package both front-end and back-end JS and CSS in one go, execute the following command in the root directory and then refresh the browser after clearing the cache for the changes to take effect:
php think min -m all -r all |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment