请求路径以域名开头,后面加请求的路径参数
layui.use(['form', 'table'], function () {
var $ = layui.$,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: 'http://localhost:8001/cms/type',
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: '编号', sort: true},
{field: 'name', width: 200, title: '名称'},
{field: 'createdTime', width: 500, title: '创建时间'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [1, 10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line'
});
数据以json格式返回
0条评论