小编Chr*_* G.的帖子

使用webpack的react-bootstrap

我正在尝试使用react-bootstrap和web pack.我能够<Button>在页面上获得引导程序,但是没有附加样式?我安装了:

 "devDependencies": {
    "babel-core": "^5.1.11",
    "babel-loader": "^5.0.0",
    "css-loader": "^0.12.1",
    "react-hot-loader": "^1.2.2",
    "react-router": "^0.13.3",
    "webpack": "^1.7.2",
    "webpack-dev-server": "^1.7.0"
  },
  "dependencies": {
    "bootstrap": "^3.3.4",
    "react": "^0.13.0",
    "react-bootstrap": "^0.22.6",
    "whatwg-fetch": "^0.8.1"
  }
}
Run Code Online (Sandbox Code Playgroud)

webpack.config.js中的加载器

  module: {
    loaders: [
      { test: /\.jsx?$/, loaders: ['react-hot', 'babel'], include: path.join(__dirname, 'app') },
      { test: /\.css$/, loader: "style-loader!css-loader" },
      { test: /\.png$/, loader: "url-loader?limit=100000" },
      { test: /\.jpg$/, loader: "file-loader" }
    ]
  }
Run Code Online (Sandbox Code Playgroud)

webpack react-bootstrap

24
推荐指数
1
解决办法
2万
查看次数

无法连接到在docker容器中运行的mongoDB

以下示例:https://docs.docker.com/engine/examples/mongodb/

当尝试连接到mongoDB时:( mongo ip:27017 其中ip是来自boot2docker ip的名称)+来自docker ps的端口号:

27017/tcp
或-P
0.0.0.0:49155->27017/tcp

无论哪种方式,我都会收到以下错误:

警告:无法连接到ip:27017,原因:错误:61连接被拒绝

错误:无法连接到服务器ip:27017(ip),src/mongo/shell/mongo.js连接尝试失败:148异常:连接失败

mongodb docker

22
推荐指数
3
解决办法
4万
查看次数

react-bootstrap 如何在选择项目时折叠菜单

选择项目后如何使菜单折叠?

我不知道如何让它在小提琴上工作,但这就是我要做的? https://jsfiddle.net/vjeux/kb3gN/

import React from 'react';
import {Navbar, Nav, NavItem, NavDropdown, DropdownButton, MenuItem, CollapsibleNav} from 'react-bootstrap';

export default class App extends React.Component {

    constructor(props) {
      super(props);
      this.onSelect = this.onSelect.bind(this);
      this.toggleNav = this.toggleNav.bind(this);
      // this.state = {navExpanded: false};
    }

    onSelect(e){
        console.log('OnSelect')
        // console.log(this.state.navExpanded);
        // this.setState({navExpanded: false});
    }

    toggleNav(){console.log('toggle...')};

    // <Navbar inverse fixedTop toggleNavKey={0} navExpanded={this.state.navExpanded} onToggle={() => this.toggleNav()}>
    // <Navbar inverse fixedTop toggleNavKey={0} navExpanded={this.state.navExpanded} >

    render() {
        return (

          <Navbar inverse fixedTop toggleNavKey={0} >
            <Nav right eventKey={0} onSelect={this.onSelect} > {/* This …
Run Code Online (Sandbox Code Playgroud)

reactjs react-bootstrap

21
推荐指数
6
解决办法
4万
查看次数

如何在Visual Studio代码中使用Delve调试器

我已经为VS Code安装了Go扩展,但无法使其正常工作.

"dlv debug"可以在终端上正常工作.

dlv debug src/github.com/user/hello
Run Code Online (Sandbox Code Playgroud)

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceRoot}",
            "env": {},
            "args": []
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

你知道怎么设置吗?

go visual-studio-code delve

20
推荐指数
2
解决办法
3万
查看次数

如何调试运行Chrome/WebKit作为远程调试器的Node.js服务器?

如果您的节点正在运行

node --debug server.js
Run Code Online (Sandbox Code Playgroud)

这给了我一个端口号xxxx,我应该在启动Chrome时使用这个端口号吗?

你从中远程调试Google\ Chrome --remote-debugging-port=xxxx吗?

或者9222是一个神奇的端口,因为它已被提及.

我是否在正确的轨道上,尝试将Chrome启动--remote-debugger到Node.js中server.js

webkit google-chrome node.js

19
推荐指数
3
解决办法
2万
查看次数

go test flag:提供标志但未定义

嗨我在go:
file_test.go中 测试时使用了一个标志var ip = flag.String("ip", "noip", "test")

我只在一个测试文件中使用它.当它只测试那个测试文件时它工作正常,但是当我运行时: go test ./... -ip 127.0.0.1另一个测试文件的alle说:flag provided but not defined.

你见过这个吗?

问候

go

18
推荐指数
2
解决办法
2万
查看次数

ES6中的childContextTypes

你如何在ES6中编写对象childContextTypes?

var A = React.createClass({

    childContextTypes: {
         name: React.PropTypes.string.isRequired
    },

    getChildContext: function() {
         return { name: "Jonas" };
    },

    render: function() {
         return <B />;
    }
});
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 reactjs es2015

16
推荐指数
3
解决办法
1万
查看次数

停止 vscode 预览滚动

在另一个选项卡中编辑时,是否可以阻止 vscode 预览滚动?

我在分割视图中打开了预览,当我在文档中滚动时,预览也会滚动。

visual-studio-code

16
推荐指数
1
解决办法
3252
查看次数

协议 --go_opt=paths=source_relative 与 --go-grpc_opt=paths=source_relative

我很难弄清楚protoc命令和 go 插件。

两者有什么不同:

protoc \
   # Directory where you want the compiler to write your Go output.
   --go_out=.
   # vs ?
   --go_opt=paths=source_relative
   # vs ?
   --go-grpc_out=.
   # vs ?
   --go-grpc_opt=paths=source_relative
Run Code Online (Sandbox Code Playgroud)

如果--go_opt生成

  • <name>.pb.go文件

--go-grpc_opt生成

  • <name>_grpc.pb.go文件

为什么甚至有--go_out

你能解释一下 protoc -文档没有说什么吗--go-grpc_opt

并且甚至protoc -h不将 go 列为 OUT_DIR?

注意:我使用此文档安装

go protoc grpc-go

15
推荐指数
1
解决办法
1万
查看次数

UITableView分页 - 底部刷新以在Swift中加载新数据

我正在尝试使用分页从后端加载数据.我已经看到了这个,但它加载了所有数据,然后是时间.这是正确的方式还是我做错了什么?

提前致谢.

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
    let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell

    print(indexPath.row)

    if (indexPath.row + 1 < self.TotalRowsWithPages) {
        cell.textLabel?.text = "\(self.myarray!.[indexPath.row].body)"
    } else {

        cell.textLabel?.text = "Loading more data...";

        // User has scrolled to the bottom of the list of available data so simulate loading some more if we aren't already
        if (!self.isLoading) {
            self.isLoading = true;
            self.TotalRowsWithPages = self.TotalRowsWithPages + self.PageSize
            self.getmoredata()
        }
    }

    return cell
}
Run Code Online (Sandbox Code Playgroud)

ios swift swift2 swift3

13
推荐指数
2
解决办法
3万
查看次数