我正在尝试更改div颜色值更改时的背景.这是我的函数,它接收颜色值:
ChangeColor(oColor) {
this.props.ChangeColor(oColor);
console.log("Refs: ", this.refs.colorPicker.className);
},
Run Code Online (Sandbox Code Playgroud)
这是css类
.colorPicker {
padding-right: 25px;
background: #000;
display: inline;
margin-right: 5px;
}
Run Code Online (Sandbox Code Playgroud)
这是我的div元素,其背景需要在运行时更新.
<div ref='colorPicker' className={this.GetClass("colorPicker")} />
Run Code Online (Sandbox Code Playgroud)
我不确定refs synatx所以请帮助解决这个问题.谢谢.
我正在尝试使用Esri地图.要在我的项目中包含地图,我发现这是:
require([
"esri/map",
"esri/dijit/Search",
"esri/dijit/LocateButton",
"esri/geometry/Point",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
Run Code Online (Sandbox Code Playgroud)
但是没有任何esri文件夹或npm包.因此,我在这里很困惑.如何在项目中导入esri?
我正在尝试保存editorState到数据库并显示回编辑器。对于这件事,我遵循了这个答案
现在,当我尝试获取当前内容并使用 永久保存它时convertToRaw,它工作正常。但是当我尝试使用这些数据并将原始数据转换为contentState使用时convertFromRaw,出现以下错误:
未捕获的类型错误:contentState.getBlockMap 不是函数
editorState这是我从保存状态转换的代码:
{
const convertedState = convertFromRaw(JSON.parse(value))
const editorValue = EditorState.createWithContent(convertedState);
}
Run Code Online (Sandbox Code Playgroud)
这样,它会在编辑器中显示数据,但是当我向富编辑器中输入内容时。它提示:
未捕获的类型错误:contentState.getBlockMap 不是函数
附:使用draft-js: '0.10.5'
例如,我想datepicker在我的rails应用程序中添加功能.我有这两个选项,也就是说,我可以安装 bootstrap-datepicker rails gem或下载 datepicker文件并包含在我的项目中.对于安全性和编译/页面加载速度,哪种方法更好?
javascript ruby-on-rails datepicker asset-pipeline twitter-bootstrap
我尝试使用时无法调用调度功能 bindActionCreators
调度功能不起作用:
@connect(state => ({oPurchaseDetails: state.cart.cartItems}), dispatch => bindActionCreators({updateItem}, dispatch))
Run Code Online (Sandbox Code Playgroud)
如果我不使用bindActionCreators,updateItem函数不起作用.
updateItem函数不起作用:
@connect(state => ({oPurchaseDetails: state.cart.cartItems}), dispatch => ({updateItem, dispatch}))
Run Code Online (Sandbox Code Playgroud) 我正在尝试mysql2为rails应用程序安装gem,但它在运行时出现以下错误sudo gem install mysql2
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /Users/ateeq/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql2-0.4.5/ext/mysql2
/Users/ateeq/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20161103-83594-10ft58j.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking …Run Code Online (Sandbox Code Playgroud) reactjs ×4
javascript ×2
arcgis ×1
css ×1
css-modules ×1
datepicker ×1
draftjs ×1
esri ×1
macos ×1
mysql ×1
node.js ×1
react-redux ×1
redux ×1
refs ×1
ruby-2.3.1 ×1