Skip to content Skip to sidebar Skip to footer

Vue.js - How To Use IView In RTL Direction?

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

Solution 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>

Post a Comment for "Vue.js - How To Use IView In RTL Direction?"