table自定义表头失效问题研究

100 阅读1分钟

1、问题背景

  表格形式的编辑,有些字段是必填,表头需要加*标记,如图:    image.png

2、问题表现

  执行情况这一栏是在某些状态下才显示出来,虽然给它也加了render-header或者slot="header"的钩子,但是*还是不显示。

3、解决方案

  解决方法如下: slot-scope="scope"是必须加的,不加的话没效果

<template slot-scope="scope" slot="header">
    <span class="red-star">*</span>执行情况
</template>