Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

问题点:使用element-ui表头选项框无法出现不确定状态

代码相同,只是改变了表头及数据
1.异常情况
image.png

2.正常情况
image.png

封装table代码:
image.png

使用处代码
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

看下你异常的表格,表格数据应该没有id字段吧,正常的表格数据是不是有id字段?
可以试试用'row-key'指定一下你的每一条数据的唯一标识。
假设你的数据是

data =[{myId:1,name:'xxx'},{myId:2,name'xxx'}]

则在table上指定

<el-table row-key='myId'></el-table>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...