修改 docs 示例中的静态模拟数据的路径

This commit is contained in:
贤心
2023-05-10 12:56:43 +08:00
parent b46186169e
commit d5bb8cf413
17 changed files with 21 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
<table class="layui-table" lay-data="{height:315, url:'{{d.root}}/static/json/table/user.json', page:true}" id="ID-table-demo-init">
<table class="layui-table" lay-data="{height:315, url:'/static/2.8/json/table/user.json', page:true}" id="ID-table-demo-init">
<thead>
<tr>
<th lay-data="{field:'id', width:80, sort: true}">ID</th>

View File

@@ -49,7 +49,7 @@
// 创建渲染实例
table.render({
elem: '#ID-table-demo-css',
url:'{{d.root}}/static/json/table/demo1.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url:'/static/2.8/json/table/demo1.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
height: 'full-35',
lineStyle: 'height: 151px;', // 定义表格的多行样式

View File

@@ -64,7 +64,7 @@ layui.use(['table', 'dropdown'], function(){
// 创建渲染实例
table.render({
elem: '#test',
url:'{{d.root}}/static/json/table/demo1.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url:'/static/2.8/json/table/demo1.json', // 此处为静态模拟数据,实际使用时需换成真实接口
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',

View File

@@ -49,7 +49,7 @@ layui.use(function(){
// 渲染
table.render({
elem: '#ID-table-demo-editmodes',
url: '{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url: '/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
css: [ // 设置单元格样式
// 取消默认的溢出隐藏,并设置适当高度

View File

@@ -14,7 +14,7 @@ layui.use(function(){
// 创建表格实例
table.render({
elem: '#ID-table-demo-editable',
url: '{{d.root}}/static/json/table/edit.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url: '/static/2.8/json/table/edit.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
//,editTrigger: 'dblclick' // 触发编辑的事件类型(默认 click )。 v2.7.0 新增,之前版本固定为单击触发
css: [

View File

@@ -9,7 +9,7 @@ layui.use(function(){
// 渲染
table.render({
elem: '#ID-table-demo-filter',
url:'{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url:'/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
toolbar: 'default',
height: 315,
cols: [function(){

View File

@@ -11,7 +11,7 @@ layui.use(['table', 'dropdown', 'util'], function(){
table.render({
elem: '#ID-table-onrowContextmenu',
defaultContextmenu: false, // 是否在 table 行中允许默认的右键菜单
url: '{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url: '/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
cols: [[
{field:'id', title:'ID', width:80, fixed: 'left', unresize: true},

View File

@@ -14,7 +14,7 @@ layui.use('table', function(){
// 创建渲染实例
table.render({
elem: '#ID-table-demo-page',
url:'{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url:'/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: { // 支持传入 laypage 组件的所有参数某些参数除外jump/elem - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'], //自定义分页布局
//curr: 5, //设定初始在第 5 页

View File

@@ -1,4 +1,4 @@
> 假设这是一段数据源:<a href="{{d.root}}/static/json/table/demo3.json" target="_blank">{{d.root}}/static/json/table/demo3.json</a><br>
> 假设这是一段数据源:<a href="/static/2.8/json/table/demo3.json" target="_blank">/static/2.8/json/table/demo3.json</a><br>
尽管它并不符合 table 组件默认规定的数据格式([#详见](#options-async-data)),但可以通过 parseData 回调将其进行转换。
<table class="layui-hide" id="ID-table-demo-parse"></table>
@@ -11,7 +11,7 @@ layui.use('table', function(){
// 渲染
table.render({
elem: '#ID-table-demo-parse',
url:'{{d.root}}/static/json/table/demo3.json',
url:'/static/2.8/json/table/demo3.json',
page: true,
response: {
statusCode: 200 // 重新规定成功的状态码为 200table 组件默认为 0

View File

@@ -38,7 +38,7 @@ layui.use(function(){
// 创建表格实例
table.render({
elem: '#ID-table-demo-search',
url: '{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url: '/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
cols: [[
{checkbox: true, fixed: true},
{field:'id', title: 'ID', width:80, sort: true, fixed: true},

View File

@@ -13,7 +13,7 @@ layui.use('table', function(){
// 渲染
table.render({
elem: '#ID-table-demo-setRowChecked',
url: '{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url: '/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
cols: [[
{type: 'radio', fixed: 'left'},

View File

@@ -27,7 +27,7 @@ layui.use(['table'], function(){
// 创建渲染实例
table.render({
elem: '#ID-table-demo-templet',
url:'{{d.root}}/static/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
url:'/static/2.8/json/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口
page: true,
height: '315px',
cols: [[

View File

@@ -1,6 +1,6 @@
常用两级表头:
<table class="layui-table" lay-data="{url:'{{d.root}}/static/json/table/demo2.json?v=2', page: true, limit: 6, limits:[6]}" id="ID-table-demo-theads-1">
<table class="layui-table" lay-data="{url:'/static/2.8/json/table/demo2.json?v=2', page: true, limit: 6, limits:[6]}" id="ID-table-demo-theads-1">
<thead>
<tr>
<th lay-data="{checkbox:true}" rowspan="2"></th>
@@ -19,7 +19,7 @@
更多级表头(支持无限极):
<table class="layui-table" lay-data="{url:'{{d.root}}/static/json/table/demo2.json?v=3', cellMinWidth: 80, page: true}" id="ID-table-demo-theads-2">
<table class="layui-table" lay-data="{url:'/static/2.8/json/table/demo2.json?v=3', cellMinWidth: 80, page: true}" id="ID-table-demo-theads-2">
<thead>
<tr>
<th lay-data="{field:'username', fixed:'left', width:80}" rowspan="3">联系人</th>