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;
}

posted @ 2021-04-03 18:06  南风晚来晚相识  阅读(4388)  评论(0)    收藏  举报