el-input只能输入大于0的整数,而且范围是0~360
<el-input " v-model="content" @input="changeInput"></el-input>
在methodslm 写方法
changeInput(e) {
let value = e.replace(/^(0+)|[^\d]+/g, '');
//如果输入框数值大于360,取余计算
if (value > 360) {
content = value % 360
} else {
content = value
}
//如果用户将input输入框内容清除且没有输入其他值,则输入框内容为0
if (value === '') {
content = 0
}
},