elementUI 自定义表头、'scope' is defined but never used

1、最近做项目时候遇到了一个自定义表头的功能,需要鼠标划上显示几个多选框,代码如下

<el-table-column prop="name">
          <template slot="header">
                  状态
                  <el-popover
                              placement="right"
                              popper-class="lists-content"
                              trigger="hover">
                              <el-radio-group v-model="radioData">
                                  <el-radio :label="1">全部</el-radio>
                                  <el-radio :label="2">24小时内</el-radio>
                                  <el-radio :label="3">72小时内</el-radio>
                                </el-radio-group>
                              <span slot="reference"><i class="el-icon-m-leibie"></i></span>
                          </el-popover>
                </template>
                <template slot-scope="scope">
                  {{scope.row.name}}
                </template>
        </el-table-column>

发现CheckBox可以显示但是无论如何都不能触发,后来修改如下,不要动原始属性!!!

 <template slot="header" slot-scope="scope">

2、eslint 报错 'scope' is defined but never used

我看报错了,就把 slot-scope="scope"去掉了,是不报错了,但是出现奇奇怪怪的问题,CheckBox不能选中,不能联动了,然后修改了一下可以了,如下:

 <template slot="header" slot-scope="{}">
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容