vue項目的elementui的form表單label的對齊方式和 el-date-picker 的長度設置


1、先按照官網的  :label-position  屬性玩了一下毫無效果;發現單獨使用這個屬性是無效的,必須和  label-width 屬性一起使用才生效;

如:

 <el-form :model="form" :rules="rules"  ref="form" inline  label-position="right" label-width="100px" status-icon>
     

  注意 label-position不能加 ‘ :’,加了會報如下錯誤:

Property or method "right" is not defined on the instance but referenced dur

 

 

2、時間選擇組件的 el-date-picker 的長度設置 ,

#在組件里加上 style="width:163px" 
#在組件里加上 style="width:163px" 

 <el-form-item prop="endTime" label="截止時間:">
              <el-date-picker
                size="small"
                v-model="form.endTime"
                value-format="yyyy-MM-dd"
                type="date"
                placeholder="選擇日期"
                style="width:163px"
              ></el-date-picker>
            </el-form-item>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM