我正在使用react-bootstrap模式.
我怎样才能让身体只滚动而不是整个页面?
<Modal.Dialog>
<Modal.Header>
<Modal.Title>Modal title</Modal.Title>
</Modal.Header>
<Modal.Body>One fine body...</Modal.Body>
<Modal.Footer>
<Button>Close</Button>
<Button bsStyle="primary">Save changes</Button>
</Modal.Footer>
</Modal.Dialog>
Run Code Online (Sandbox Code Playgroud) 我想初始化Jenkins不是通过服务,而是通过我自己(作为Windows用户)在cmd!
我如何读取此文件“ file.json”:
# Comment01
# Comment02
{
"name": "MyName"
}
Run Code Online (Sandbox Code Playgroud)
并检索不带注释的json?
我正在使用此代码:
var fs = require('fs');
var obj;
fs.readFile('./file.json', 'utf8', function (err, data) {
if (err) throw err;
obj = JSON.parse(data);
});
Run Code Online (Sandbox Code Playgroud)
它返回此错误:
SyntaxError: Unexpected token # in JSON at position 0
Run Code Online (Sandbox Code Playgroud)
有npm一些软件包可以解决这个问题吗?
如何检测为文件定义了哪种编码?
我想要这样的东西:
fs.getFileEncoding('C:/path/to/file.txt') // it returns 'UTF-8', 'CP-1252', ...
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法可以使用nodejs本机函数来做到这一点?
我可以创建一个将键值作为模板字符串传递的对象吗?
const key = 'my-key', value = 'my-value'
const obj = {
`${key}`: value
}
Run Code Online (Sandbox Code Playgroud)
有替代方法吗?
node.js ×2
ecmascript-6 ×1
encoding ×1
file ×1
javascript ×1
jenkins ×1
json ×1
modal-dialog ×1
npm ×1
reactjs ×1
readfile ×1
scroll ×1