Vue3 element-plus el-select 内联样式字体不生效,请教解决方法

外联 可以更改,但是 内联字体没用,我的需求只能用内联
            <el-select
              class="selectData"
              v-model="col.val"
              :style="{
                '--el-font-size-base':'12px',     // 这样可以生效,   直接 font-size:12px 不生效
               'font-family: '宋体',        //  这里字体不生效,我也没找到 --el-font-family-base 类似变量, 在控制台  'font-family: '宋体',   被划了横线
              }" 
            >
              <el-option value="1"/>
              <el-option value="2"/>
            </el-select>




下面这段内联可以生效,但是 el-select 中用 :input-style 是没用的
<el-input
              :input-style="{
                'font-size': col.style.font_size +'px',
                'letter-spacing': col.style.letter_spacing + 'px',
              }" 
            />



在全局 添加

 .el-input__inner {
            font-size: inherit;
            letter-spacing: inherit;
        }

img

重写组件样式

/deep/.el-input__inner{
               'font-family: '宋体',  
font-size:12px      

}


你的目的是修改select包括option内的文本间隔以及字体大小吗

首先要确认col.style.font_size和col.style.letter_spacing是有数据的
改一下

 :input-style="{
                fontSize: col.style.font_size +'px',
                letterSpacing: col.style.letter_spacing + 'px',
              }"