vue+elementui输入框必须输入数字及小数且可限制长度
<template>
<el-input type="number" oninput="if(value.length>12)value=value.slice(0,12)">
</el-input>
</template>
<style lang="scss" scoped>
/deep/ input::-webkit-outer-spin-button,
/deep/ input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
/deep/ input[type="number"] {
-moz-appearance: textfield;
}
/deep/ .el-input__inner {
line-height: 1px !important;
}
</style>