Home  >  Article  >  Web Front-end  >  Comparison of usage differences between different versions of layui

Comparison of usage differences between different versions of layui

王林
王林forward
2020-12-02 15:05:342605browse

Comparison of usage differences between different versions of layui

Comparison of usage differences between different versions of layui

(Related recommendations: layui)

1. Obtain the Form module Interface, changed from the previous var form = layui.form() to: var form = layui.form

2. Get the Element module interface, changed from the previous var element = layui.element() to: var element = layui.element

The example is as follows:

//2以上版本:
layui.use(['layer', 'form', 'element'], function(){
  var layer = layui.layer
  ,form = layui.form
  ,element = layui.element

});
//1.x版本:
layui.use(['layer', 'form', 'element'], function(){
  var layer = layui.layer
  ,form = layui.form()
  ,element = layui.element()

});

The above is the detailed content of Comparison of usage differences between different versions of layui. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete