admin管理员组文章数量:1391955
I am using v-text-field
and it is not able to set text-align
to center
.
I tried these solutions but not working.
1.
<v-text-field type="number" class="mr-2 text-center"></v-text-field>
<v-text-field type="number" class="mr-2 centered-input"></v-text-field>
.centered-input >>> input {
text-align: center;
}
I am using v-text-field
and it is not able to set text-align
to center
.
I tried these solutions but not working.
1.
<v-text-field type="number" class="mr-2 text-center"></v-text-field>
<v-text-field type="number" class="mr-2 centered-input"></v-text-field>
.centered-input >>> input {
text-align: center;
}
Share
Improve this question
edited Oct 22, 2020 at 9:21
Prime
asked Oct 22, 2020 at 9:05
PrimePrime
2,8492 gold badges10 silver badges24 bronze badges
2 Answers
Reset to default 4It will not work if you give style in the current Vue file. You should add the style as global.
.centered-input input {
text-align: center;
}
Or it seems like that you've added scoped
to <style>
tag. You can remove it to make the style as global.
From
<style lang="scss" scoped>
To
<style lang="scss">
Try this approach:
<v-text-field type="number" class="my-field" />
.my-field {
width: 200px;
}
.my-field input {
padding: 10px;
background: #ccc;
text-align: center;
}
本文标签: javascriptvtextfield textcenter not working VuetifyStack Overflow
版权声明:本文标题:javascript - v-text-field text-center not working Vuetify - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744710596a2621104.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论