Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

element-ui部分表的表头选项框无法出现不确定状态

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

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

2.正常情况
image.png

封装table代码:
image.png

使用处代码
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

则在table上指定

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...