forEach数组遍历判断

check_count: function(event) {
                var value = event.target.value;
                if (!/^\d*\.{0,1}\d{0,2}$/.test(value)) {
                    this.$alert('只能输入数字和小数点', '提示', {
                        confirmButtonText: '确定',
                        callback: action => {
                            this.$message({
                                type: 'info',
                                message: `action: ${ action }`
                            });
                        }
                    });
                    event.target.value = '';
                }
            },

猜你喜欢

转载自blog.csdn.net/weixin_43837268/article/details/89598828