iView - How to use in RTL layout?

耗尽温柔 提交于 2019-12-11 13:41:59

问题


I'm creating an Arabic website with 'Vue.js', and I use iView for UI components, but the problem is that it's designed for LTR layouts while Arabic is RTL. How can I convert iView components to RTL??

Example: I want to make the search button in the input field on the left in this website "it's now on the right"


回答1:


You could simply use dir='rtl' attribute like <i-input dir="rtl" .../> but the problem is with the search button which will not fit appropriately, so to fix that add some CSS rules like i did in the following working example :

var Main = {

}

var Component = Vue.extend(Main)
new Component().$mount('#app')
@import url("//unpkg.com/iview/dist/styles/iview.css");
#app {
  padding: 32px;
}



.ivu-input-group-append,
.ivu-input-group>.ivu-input:last-child {
  border-radius: 4px 0 0 4px!important;
 
}
.ivu-input-search::before{
width:0;
}
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/iview/dist/iview.min.js"></script>
<div id="app">
  <div>
    <i-input search enter-button search placeholder="ابحث عن طريق الإسم أو المدينة" dir="rtl" />

  </div>
</div>


来源:https://stackoverflow.com/questions/53089736/iview-how-to-use-in-rtl-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!