Screenshot of error reporting:
reason:
Because we did not pre load and define the built-in module of $layui, it is not loaded by default. It must be loaded after you execute this method
Solution:
Before using $
in layui, you need to add a sentence var $= layui.$
. Otherwise, an error of $is not defined will be reported