提交 31c61a67 编写于 作者: alex.zhang's avatar alex.zhang

应用配置序号为1~10的正整数

上级 297ac618
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-table-column> </el-table-column>
<el-table-column label="序号" width="200"> <el-table-column label="序号" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.seqNo" style="width:60px;" size="small" placeholder="序号"/> <el-input v-model="scope.row.seqNo" style="width:60px;" size="small" @blur="BlurText($event)" @placeholder="序号"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -162,9 +162,19 @@ export default { ...@@ -162,9 +162,19 @@ export default {
cancle(){ cancle(){
this.$router.go(-1); this.$router.go(-1);
} },
BlurText(e) {
console.log("BlurText() : e = " + e.target.value)
let b = new RegExp("^[1-9][0-9]*$").test(e.target.value)
if (e.target.value >= 10) {
b = false
}
if (!b) {
this.$message.warning('请输入 1~10 的正整数')
e.target.value = ''
}
}
}, },
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册