要让文本居中,可以使用 CSS 样式来实现。在 el-input 组件上添加一个 class 属性,然后在样式表中设置该 class 的样式为居中即可。

HTML 代码:

<el-input v-model='query.oid' readonly class='centered'></el-input>

CSS 样式:

.centered {
  text-align: center;
}

这样设置之后,文本就会在 el-input 组件中居中显示。

Element UI el-input 文本居中显示方法

原文地址: https://www.cveoy.top/t/topic/qz1E 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录