el-select Add field unit display in the drop-down selection box Add unit display before the el-select drop-down button

Background: el-select can add units in the drop-down options through a custom template, but the units cannot be displayed after selection

achieve effect

el-select Add field unit display in the drop-down selection box Add unit display before the el-select drop-down button

implement the code

html

			  <el-select
                v-model="form.day"
                class="select-prefix"
              >
                <el-option label="1" :value="1" />
                <el-option label="2" :value="2" />
                <el-option label="3" :value="3" />
                <el-option label="4" :value="4" />
                <template slot="prefix"></template>
              </el-select>

css

.select-prefix .el-input__prefix{
    right: 30px;
    cursor: pointer;
}

Guess you like

Origin blog.csdn.net/gjwgjw1111/article/details/131580522