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

Categories

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

el-checkbox border 能否实现根据label的实际长度而调整外层线框的的长度

一般我之前实现都是固定一个合适的长度130px左右,但是我现在想要做到让el-checkbox中的整个框能随着label实际长度的变化而变化,下面是效果对比图.

正常条件下:
image.png

但是现在label中的字一多就会这样:
image.png

能比较直观的看到里面的label直接就跳出去了, 有什么办法可以让整个线框随着label的变化而变化啊? 前端小白在这里等大佬回答.


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

1 Answer

0 votes
by (71.8m points)

组件自身本来就是自适应宽度的;你是在哪里设置宽度限制了吧;
如果要设置宽度请改为 min-width


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...