如何为两个数字的范围设置验证。我想将第一个数字的最大值设置为第二个数字的值,将第二个数字的最小值设置为第一个数字的值。这是我的js代码:
min_num : {
validators : {
integer : {
message : 'Please enter the valid number ',
min : 1,
max : 'max_num'
},
notEmpty : {
message : 'Please enter the number'
}
}
},
max_num : {
validators : {
integer : {
message : 'Please enter the valid number ',
min : 'min_num',
max : 10000
},
notEmpty : {
message : 'Please enter the number'
}
}
}
Run Code Online (Sandbox Code Playgroud)
和 HTML:
<div class="form-group">
<label class="col-md-2 control-label">Min …
Run Code Online (Sandbox Code Playgroud) 我有反应应用程序的问题.我从git克隆它并运行命令npm install和npm start,我收到了这个错误.
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! front-end-react@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the front-end-react@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete …
Run Code Online (Sandbox Code Playgroud)