V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  eromoe  ›  全部回复第 2 页 / 共 3 页
回复总数  48
1  2  3  
2016-07-19 19:48:54 +08:00
回复了 eromoe 创建的主题 Docker docker 有什么加速的办法? DaoCloud 太坑
@shiny 囧。。。没写 hyper-v 版的 docker 咋搞。。。。
2016-07-19 19:48:07 +08:00
回复了 eromoe 创建的主题 Docker docker 有什么加速的办法? DaoCloud 太坑
@eromoe 哦。。。原来要进管理中心啊。。。
2016-07-19 19:47:12 +08:00
回复了 eromoe 创建的主题 Docker docker 有什么加速的办法? DaoCloud 太坑
@shiny 没看到 配置说明文档啊。。。这个东西 ? https://help.aliyun.com/knowledge_detail/40557.html
感觉不太像。。。
2016-06-29 15:37:37 +08:00
回复了 eromoe 创建的主题 webpack 怎么在 webpack devserver 里 用相对路径 import scss(font-awesome)?
@jeremaihloo 文件夹和 main.scss 同层。。。
2016-06-29 14:53:45 +08:00
回复了 daimoon 创建的主题 前端开发 说说我为什么选择了 vue 而不是 react
react 我花了 3 个星期才搞懂。。。虽然只是闲的时候看一下。。。最后硬是开始搞个项目,问问题才弄懂。。。
2016-06-21 16:43:26 +08:00
回复了 eromoe 创建的主题 React 如何用 react-redux 创建可以自包含的 component ?
突然想到 可以 直接传个 完整对象进去。。。只要做个 map {path: children}就好了,不用传整个树
action 更新这个 map 。。。应该可行
2016-06-21 15:50:50 +08:00
回复了 eromoe 创建的主题 React 如何用 react-redux 创建可以自包含的 component ?
@SuperMild 他这个只有一层,不是自己嵌套自己,所以没有这个问题。。。
2016-06-20 20:25:15 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
@yesmeck 找到问题了~ 我在 TreeNode 下面也写了 connect , 原来所有子元素都是需要继承父元素的啊,除非是不同的根元素,否组不能加 connect 。
2016-06-20 17:33:38 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
@yesmeck Oh! 不好意思。。。换了台机子, ssh 有 passphrase , git push 之后就没注意。。。
2016-06-20 17:24:16 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
@yesmeck
又发现个问题。。。 我想把 node 的信息显示出来
App.render:
```
{nodes.map(node =>
<TreeNode key={node.name} info={node} />
)}
```

在 TreeNode.render:
```
const { actions, nodes, info } = this.props
return (
<a>{info.name}</a>
);
```

貌似 info 没有传进去。。。 log 显示是 undefined


warning.js?8a56:45 Warning: Failed propType: Required prop `info` was not specified in `TreeNode`. Check the render method of `Connect(TreeNode)`.

TreeNode.js?10ab:57 Uncaught TypeError: Cannot read property 'name' of undefined


google 了一圈 没看到问类似问题的,都是什么 parent 传数据到 child 的问题,他们的 child 都是已经存在的。。。
如果这些信息没办法判断问题的话, 我也更新了 gitbub
2016-06-20 15:11:55 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
@yesmeck 非常感谢! 我刚刚也是发现能直接用这个 this.props.getFileList(); 然后豁然开朗, 现在感觉都串起来了~谢谢~
2016-06-20 14:36:01 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
一开始没想到,只要下面这么简单就行了,因为总是觉得 reducer 只是用来更新的,不能初始化,又戳破了一个盲点~

componentWillMount() {
// this will update the nodes on state
this.props.getFileList();
}

render() {
// will be re-rendered once store updated
const {nodes} = this.props;
// use nodes
}

function mapStateToProps(state) {
return {
nodes: state.nodes
};
}

export default connect(
mapStateToProps,
{ getFileList: ansyncGetFileList }
)(App);
2016-06-20 14:23:18 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
2016-06-20 14:00:54 +08:00
回复了 eromoe 创建的主题 React react-redux 初始化 获取 数据,并生成元素加入到页面上
@spritevan 噢!谢谢指出, 这里是不是用 var { xx } = xxx; 或者 {...nodes} 更好?

@yesmeck
加了 constructor ,我在想是不是能在 constructor 里直接赋初始值,但是好像又在哪里看到 react 不建议这么做,又好像没有。。。
代码改成下面这样
1.
```
render() {
const { actions } = this.props
const { nodes } = this.state
console.log(nodes)
return (
<div className="main-app-container">
<Home />
<div className="main-app-nav">Simple Redux Boilerplate</div>
{nodes.nodes.map(node =>
<TreeNode key={node.name} node={node} {...actions} />
)}
<Footer />
</div>
);
}
```
log 出来如下,而且页面不显示

[]

错误:App.js?4495:35 Uncaught TypeError: Cannot read property 'map' of undefined

2.

```
render() {
const { actions } = this.props
const { nodes } = this.state
console.log(nodes)
return (
<div className="main-app-container">
<Home />
<div className="main-app-nav">Simple Redux Boilerplate</div>
{nodes.map(node =>
<TreeNode key={node.name} node={node} {...actions} />
)}
<Footer />
</div>
);
}
```
不用 nodes.nodes.map ,会 log 2 遍,然后显示出页面 ,并报错

[]
Object {nodes: Array[3]}

错误 : App.js?4495:35 Uncaught TypeError: nodes.map is not a function

3. 修改赋值部分
```
componentDidMount() {
let {nodes} = getFileList()
this.setState({
nodes: nodes
})
}
```
使用 2. 原始的 render 就不会出错,按理来说
var { nodes} = getFileList();
nodes.map

应该等于
var nodes = getFileList();
nodes.nodes.map

好奇怪。。。
2016-06-14 14:11:06 +08:00
回复了 eromoe 创建的主题 Node.js npm 包 安装,重装 的问题
补充上面的,后来发现不是版本的问题,还是 node_modules 的问题,因为删了 2 次都出错,还以为是我装错了。。。
第三次删了装就好了。。。
2016-06-14 14:10:06 +08:00
回复了 eromoe 创建的主题 Node.js npm 包 安装,重装 的问题
@fds 之前也是用 4 的 lts ,前 2 天碰到项目,安装完起不来, npm 提示是请把 node 升级到最新,如果还是出错那就联系作者,之类的意思,然后 github 里看到很多人都是用 5.0 以上的,有些包有的人说升级到 5.6 就没问题了
所以我就升了
2016-06-14 13:58:55 +08:00
回复了 eromoe 创建的主题 Node.js npm 包 安装,重装 的问题
@scarlex 请看主题,我一开始就上淘宝源了
2016-06-14 13:19:15 +08:00
回复了 eromoe 创建的主题 Node.js npm 包 安装,重装 的问题
@learnshare 我现在碰到问题也只能删 node_modules 重装
就是觉得 node 社区这么大,怎么连一个包管理都有问题。。。这问题超难受。。。碰到大项目等半天。。。结果还是不行,删掉重来 T T
2016-06-14 12:48:44 +08:00
回复了 eromoe 创建的主题 Node.js npm 包 安装,重装 的问题
@fds npm install 经常会有什么编译失败之类的,但是貌似问题不大,有的时候能把项目跑起来,跑步起来就重新 npm install, 确实错误信息 会有一些写着 npm build 的,但是好像不是这个问题

@mgcnrx11 唉。。。这安装和删除的速度实在让人受不了啊。。。。
2016-05-16 13:36:57 +08:00
回复了 impig33 创建的主题 Google google voice 的几个问题
同样选号失败。。。写了脚本 刷了 2 个小时还没反应
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1217 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 17:31 · PVG 01:31 · LAX 10:31 · JFK 13:31
Developed with CodeLauncher
♥ Do have faith in what you're doing.