Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table组件,可否增加参数设置loading的样式 #1884

Closed
4 tasks done
yhl452493373 opened this issue May 10, 2024 · 3 comments · Fixed by #1893
Closed
4 tasks done

table组件,可否增加参数设置loading的样式 #1884

yhl452493373 opened this issue May 10, 2024 · 3 comments · Fixed by #1893
Labels
feature 功能请求 Feature Request

Comments

@yhl452493373
Copy link

议题条件

  • 我确认已查看官方使用文档:https://layui.dev ,但没有找到相关解决方案。
  • 我确认已在 Issues 中搜索过类似的问题,但没有找到相关解决方案。
  • 我已仔细阅读: 🍀 Layui Issue 贡献指南

议题类型

功能请求

使用版本

2.9.8

问题描述

项目中loading统一用的layui.layer.load(1),这个和table默认的不一致,也没找到参数能修改。可否加一个这个参数?

业务代码

截图补充

No response

浏览器

124.0.6367.119

演示地址

No response

友好承诺

  • 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。
@sentsim
Copy link
Member

sentsim commented May 10, 2024

或许的确可以增加一个函数,用于替代默认的加载风格。

@sentsim sentsim added the feature 功能请求 Feature Request label May 10, 2024
@yhl452493373
Copy link
Author

或许的确可以增加一个函数,用于替代默认的加载风格。

那能否顺便给layer.msg('提示文字',{icon:16})时,的loading样式一起加了,icon:16的时候也是固定的layer.load(0)的样式

@sentsim
Copy link
Member

sentsim commented May 21, 2024

如果要保持两者加载的统一,可以禁用 table 默认的加载,再通过 before 回调加上 layer 的加载条

loading: false, // 禁用 table 默认加载条
before: function() { // 数据渲染前
  this.loadIndex = layer.msg('一段提示信息',{
    icon:16
  });
},
complete: function() { // 数据请求完
  layer.close(this.loadIndex)
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 功能请求 Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants