el-input-number 只能输入整数,最小值1,最大值5

<el-form-item

              label="排序"

              prop="name"

            >

              <el-input-number

                v-model="form.sort"

                placeholder="请输入唯一排序"

                :min='1'

                :max="5"

                :precision="0"

                class="custom-input-number"

              />

</el-form-item>

《=====解释====》

precision:限制只能输入整数,min:最小输入1,max:最大输入5

::v-deep {

  /* 添加一个自定义类来覆盖默认的高度 */

  .custom-input-number .el-input-number__increase,

  .custom-input-number .el-input-number__decrease {

    height: 30px; /* 修改为你想要的高度 */

    line-height: 30px;

    margin-top: 1px;

  }

}

猜你喜欢

转载自blog.csdn.net/qq_42080594/article/details/138217174