我的演示运行不顺利.
https://github.com/jiexishede/react-redux-demo01
错误是:
我不知道如何解决这个错误.这个错误让我停止了两个多小时.我要问别人帮助我.
当我在本地编写代码时,有时我会提交不干净的代码,或者使用丑陋的消息作为临时修订.
但是,当我希望我的代码与其他代码合并时,我想要另一个可以看到的唯一最终快照,(隐藏看起来很难看的修订版)
防爆.我将0分叉到我的本地存储库,我进行更改并测试并使用不干净的代码进行提交
0-> 1-> 2-> 3-> 4-> 5-> 6(最终代码)
当其他人拉代码时,是否有可能让其他人看到最终状态?而不是从1..5看到树
我希望用户会看到像
0 -------------------> 6
我能想到的一种方法是制作补丁文件,但如果有一些文件必须删除或创建,那就不够好了.
我从后端请求数据.数据是礼物数据和人物数据.
我的目标是实现连接礼物和人.每个人都送礼物.
我使用material-ui
和redux-form
包.
人员数据树如下:
persons: "
[ {
name:'person1_name',
userID:'person1_userID',
hobbies: persondata -> the same to persons
},
{
name:'person2_name',
userID:'person2_userID',
hobbies: persondata -> the same to persons
},
{
name:'person3_name',
userID:'person3_userID',
hobbies: persondata -> the same to persons
}
]
Run Code Online (Sandbox Code Playgroud)
我想得到这个结果:我点击select
,3(如果后端人数据是3人)人item
(选项)显示.
我使用redux状态state.sendGood.driftMemberArray.formData
来保存人员数据.
我的代码如下:
import React from 'react'
import {Field, FieldArray, reduxForm } from 'redux-form'
import { connect } from 'react-redux'
import SelectField from 'material-ui/SelectField'
import MenuItem from 'material-ui/MenuItem'
const …
Run Code Online (Sandbox Code Playgroud) 本机反应:如何在Android上设置Image defaultSource.
我已经阅读了React native
1.58文件.我发现Image props defaultSource
仅支持iOS.
我需要在网络图像加载错误时设置默认图像.
我以前写这样的代码:
{ ImageUrl?
<Image style={styles.docimg}
source={{uri: ImageUrl}}/>
:
<Image style={styles.docimg}
source={require('../../../resource/default.png')}/>
}
Run Code Online (Sandbox Code Playgroud)
现在有一个问题.当URL是字符串类型,但它不是正确的网络图像.由于URL是true
图像将不显示任何内容.
我看到Image道具onError
可能解决了我的问题.
我需要设置占位符Image.
我的git存储库有两个分支,master
和bug
.我想创建一个分支bug/rep
.所以我跑:
git branch bug/rep
Run Code Online (Sandbox Code Playgroud)
这给出了错误:
错误:无法解析引用refs/heads/bug/rep:不是目录致命:无法锁定ref'refs/heads/bug/rep'.
如何从bug
分支创建子分支,比如bug/rep
?我的git版本在Mac上是2.3.2.
我使用React来编写这个演示.我使用Webpack来构建这个demo.当我开始这个演示时,错误将显示给我.
./src/app.js中的错误模块构建失败:SyntaxError:意外的令牌(8:24)
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
class Button extends Component {
constructor(props){
super(props);
}
static defaultProps = {
color:'blue',
text: 'Confirm',
}
render (){
return (
<button className={'btn btn-${color}'}>
<em>{text}</em>
<p>This is a button.</p>
</button>
);
}
}
ReactDOM.render(<Button />, document.getElementById('app'));
Run Code Online (Sandbox Code Playgroud)
我从一本书中读到了这个演示.由于该书可能打印错误的代码.所以我现在问这个问题.
错误显示static defaultProps = {
不对.这本书也是用这个表格写的.你知道正确的代码吗?
我阅读了角度动画文档并重新创建了演示.如果单击该Fold In
按钮,文本将更改为animate define
.该演示不能很好地运行.该动画不能很好地工作.
这是我的代码:https: //jsfiddle.net/jiexishede/5nokogfq/
在Webstorm中:
我改变var app = angular.module('app', []);
为var app = angular.module('app', ['ngAnimate']);
.错误显示:
Uncaught Error: [$injector:unpr] Unknown provider: $$isDocumentHiddenProvider <- $$isDocumentHidden <- $$animateQueue <- $animate <- $compile <- $$animateQueue
http://errors.angularjs.org/1.5.8/$injector/unpr?p0=%24%24isDocumentHiddenP…eQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue
at angular.js:68
at angular.js:4511
at Object.getService [as get] (angular.js:4664)
at angular.js:4516
at getService (angular.js:4664)
at injectionArgs (angular.js:4688)
at Object.invoke (angular.js:4710)
at angular.js:4517
at getService (angular.js:4664)
at injectionArgs (angular.js:4688) …
Run Code Online (Sandbox Code Playgroud) 我的问题是如何安装1.4.0 beta版本2.我已阅读该CocoaPod
网站.
https://guides.cocoapods.org/using/getting-started.html#getting-started
我想更新CocoaPod
,作为网站中的命令.
$ [sudo] gem install cocoapods
因此,始终安装1.3.1版本
我用这个命令是不正确的.
sudo gem install -n /usr/local/bin cocoapods 1.4.0 beta 2
然后我问这个问题.
我想使用xib来设置静态UITableview.怎么办才能搞定?我没有找到设置tableView静态或动态的按钮.如何使用故事板?
如何同时运行ios和android模拟器?
现在,我使用ios模拟器iPhone 6,并使用Genymotion运行Android。
我cd
到我的项目路径。我可以运行iOS模拟器。我也很好地运行了Android模拟器。现在,当我同时运行Android模拟器和iOS模拟器时,只有一个模拟器运行良好。然后我选择iOS模拟器并键入命令+ ??? iOS模拟器运行良好,然后Android模拟器显示红色屏幕,文本显示给我:
我选择Android模拟器并重新加载android。然后,Android模拟器运行良好,但iOS模拟器屏幕变为红色,错误文本显示:
bash文本是这样的:
Loading dependency graph...
React packager ready.
Loading dependency graph, done.
Bundling `index.ios.js` 100.0(1274/1274), done.
Bundling `index.android.js` 100.0(1126/1126), done.
Bundling `index.android.js` 100.0(1272/1272), done.
Run Code Online (Sandbox Code Playgroud)
我看到两个模拟器不能同时运行。
有没有一种方法可以同时运行两个模拟器?
=======
我重新启动mac并运行iOS和Android模拟器,现在两个模拟器同时运行良好。
我在我的 iOS 项目中使用了“swiftlint”。我还知道在终端中的项目根路径中输入“swiftlint auto Correct”来纠正一些警告和错误。
Run
当我在 Xcode 中运行项目时,有没有办法运行“swiftlint auto Correct” ?
. 不建议使用这种方式使用命令“swiftlint auto Correct” swiftlint
。
我发现使用“swiftlint 自动更正”的方法是在终端中输入它。
在 Xcode 中“运行”时使用“swiftlint 自动更正”是否是一个好的做法?
订单是flex中的有用属性。
我在互联网上搜索。
摘要CSS order属性指定用于在其flex容器中布置flex项目的顺序。元素以顺序值的升序排列。具有相同顺序值的元素按照它们在源代码中出现的顺序进行布局。
<View style={{display:'flex'}}>
{ item.cover ? <Image style={[styles.item, styles.newsItem]} source={{uri:item.cover}}/> : null }
{ item.title ? <Text numberOfLines={1} ellipsizeMode='tail' style={styles.newsTTopTitle} source={{uri:item.cover}}>{item.title}</Text> : null }
{ item.description ? <Text numberOfLines={1} ellipsizeMode="tail" style={styles.newsTSubTitle} source={{uri:item.cover}}>{item.description}</Text> : null }
</View>
</TouchableOpacity>
newsTSubTitle: {
fontSize:10,
lineHeight:13,
color:'#9B9B9B',
width:233,
textAlign:'left',
alignSelf:'flex-end',
order:2,
},
newsTTopTitle: {
fontSize:12,
lineHeight:15,
color:'#000000',
width:233,
textAlign:'left',
alignSelf:'flex-end',
order:1,
},
Run Code Online (Sandbox Code Playgroud)
我的编码器如上,结果显示错误。
还有一件事。该item.cover
有时候没有价值。然后将Text
will布局在父亲视图的顶部。我想将Text
组件设置在父亲视图的底部。在这种情况下,我应该放置一个占位符图像吗?
在RN Flatlist
Doc单元中,有一个描述:
为了限制内存并实现平滑滚动,内容在屏幕外异步呈现。这意味着滚动速度可能会比填充率快,并会立即看到空白内容。这是可以根据每个应用程序的需求进行调整的折衷方案,我们正在努力在幕后进行改进。
我面临这个问题,有时内容空白。使用Flatlist
组件时如何提高填充率?
react-native ×4
reactjs ×4
git ×2
ios ×2
android ×1
angularjs ×1
branch ×1
cocoapods ×1
css ×1
flexbox ×1
image ×1
javascript ×1
material-ui ×1
objective-c ×1
redux ×1
redux-form ×1
storyboard ×1
uitableview ×1
xcode ×1