How to import Excel from layui: First download the layui-excel plug-in from Github or Code Cloud; then introduce jQuery and the plug-in source code, and call the function through the global variable "LAY_EXCEL".
#The operating environment of this tutorial: Windows 7 system, layui-excel v1.6.6 version, Dell G3 computer.
Recommended: "layUI Tutorial"
When we use layui for development, we often encounter the problem of importing and exporting data. Here we will introduce a plug-in for you. , you can import Excel data or export data to excel.
Environment Tips: The preview environment needs to be deployed on the server, otherwise the data that needs to be exported cannot be obtained asynchronously
The export excel function of this plug-in is based on XLSX.js, the download function is based on FileSaver, and the file reading function is based on FileReader for H5.
Download address:
Github: https://github.com/wangerzi/layui-excel
Code Cloud (faster domestic download) : https://gitee.com/wangerzi/layui-excel
Browser compatibility:
Supports IE10, Firefox, chrome and other mainstream browsers
Non-layui or non-modular support
Introduce jQuery and plug-in source code, call the function through the global variable LAY_EXCEL, see the demo for details: http://excel.wj2015.com/demos/noLayui/index. html
Function demonstration:
1. Function demonstration:
2. Export data test and export interface data:
Import Data:
The above is the detailed content of How to import Excel from layui. For more information, please follow other related articles on the PHP Chinese website!