elementui中自定義Select選擇器樣式自定義


<el-select class="my-el-select" v-model="tenantCont" placeholder="請輸入機構標識">
     <el-option-group
         v-for="group in options"
         :key="group.label"
         :label="group.label">
            <el-option
                v-for="item in group.options"
                :key="item.value"
                :label="item.label"
                 :value="item.value">
             </el-option>
       </el-option-group>
 </el-select>
options: [{
    label: '之前登錄的機構標識',
          options: [
               {
                   value: '000001',
                   label: '藍翔1山東藍翔1(機構標識001)'
               }, {
                   value: '000002',
                   label: '藍翔1山東藍1山東藍翔1(機構標識001)'
               },
               {   
                 value: '000003',
                   label: '藍翔1山東藍翔1(機構標識001)',
                }
             ]
}]
// 之前登錄的機構標識 居中
.el-scrollbar .el-select-group__wrap /deep/ .el-select-group__title{
    text-align: center !important;
}
// 內容居中
.el-scrollbar .el-select-group__wrap /deep/ .el-select-dropdown__item{
    text-align: center !important;
}
// 去除點擊時候的淡藍色邊框
.my-el-select /deep/ .el-input .el-input__inner {
   border-color: #DCDFE6  !important;
}


免責聲明!

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



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