【layUI杂记】layui之在layui的table表格数据添加a标签

## 2019-04-01-layui 在layui的table表格数据添加a标签.md
 
有时候我们设计表格的时候,需要在表格中添加a标签元素, layui中示例中讲解了input标签的时候,我做项目的时候尝试使用a标签,以下便是示例:
 
```python
<script type="text/html" id="checkboxTpl">
  <a href="javascript:;" onclick="show_schedule_detail({{ d.id }})">{{ d.title }}</a>
</script>
layui.use('table', function () {
    var table = layui.table;
 
    table.render({
        elem: '#test'
        , url: '${SITE_URL}news/show/details/'
        , method: 'post'
        , where: {
            'check_type': parent_show_type
        }
        , cols: [[
            , {field: 'release_time', title: '发布时间', width: 102}
            , {field: 'title', title: '标题', templet: '#checkboxTpl'}
            , {field: 'user', title: '发布者', width: 160}
        ]]
        , page: true
        , limit: 15
        , limits: [15, 30, 45]
    });
```
 
posted @ 2022-04-26 14:50  郭祺迦  阅读(1712)  评论(0)    收藏  举报