fastadmin bootstrap table 表格列表设置自动刷新

一、修改文件 \public\assets\js\require-backend.js

①增加一行

'bootstrap-table-auto-refresh': '../libs/bootstrap-table/dist/extensions/auto-refresh/bootstrap-table-auto-refresh',

②增加三行

'bootstrap-table-auto-refresh': {
  deps: ['bootstrap-table'],
  exports: '$.fn.bootstrapTable.defaults'
},         

二、修改文件 public\assets\js\require-table.js

添加一个属性

'bootstrap-table-auto-refresh'

三、在生成的对应js文件中增加两行

autoRefresh:true,//true=开启
autoRefreshInterval:10

四、最后在终端重新打包一下框架js、css

php think min -m backend -r all

 

列表页会出现一个钟表图标

 

 

五、测试

刷新页面,试着打开一个新的浏览器窗口,添加好数据,观察之前的页面,发现数据自动出现,证明设置成功。

 

posted @ 2023-07-25 07:24  温柔的风  阅读(1101)  评论(0编辑  收藏  举报