show-overflow-tooltip屬性
element-ui表格 默認(rèn)情況下若內(nèi)容過(guò)多會(huì)折行顯示,若需要單行顯示可以使用show-overflow-tooltip屬性,它接受一個(gè)Boolean,為true時(shí)多余的內(nèi)容會(huì)在 hover 時(shí)以 tooltip 的形式顯示出來(lái)。
默認(rèn)情況
element-ui表格 show-overflow-tooltip="true",鼠標(biāo)移上去會(huì)顯示如下圖的樣子:
show-overflow-tooltip顯示的寬度設(shè)置
對(duì)tooltip的寬度進(jìn)行設(shè)置
<style lang="css">
? .el-tooltip__popper{font-size: 14px; max-width:50% }
</style>
注意寫法:
<style scoped lang="scss"> ::v-deep .el-cascader-menu { width: 20%; min-width: 20%; max-width: 20%; } ::v-deep .el-cascader-node__label { padding-right: 2px; } </style> <style lang="css"> .el-tooltip__popper{font-size: 14px; max-width:20% } </style>
.el-tooltip__popper無(wú)效問(wèn)題解決
切記:修改elementui自帶樣式的話,不能在<style scoped></style>中修改,因?yàn)椴粫?huì)生效。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-722955.html
例如下面這樣是不會(huì)生效的,文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-722955.html
<style lang="css" scoped> ? .el-tooltip__popper{font-size: 14px; max-width:50% } </style>
到了這里,關(guān)于eltable el-tooltip__popper 換行、字體、顏色等調(diào)整的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!