我正在尝试在节点 0.12 中安装 node_xslt 模块,但失败了。我有 python 版本 2.7 和 node-gyp 版本 2.0.2。
这是错误堆栈 -
> node_xslt@0.1.9 preinstall /home/ritesh/Ritesh/projects/applane1/node_modules/node_xslt
> node-gyp rebuild
/bin/sh: 1: xml2-config: not found
gyp: Call to 'xml2-config --cflags' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command …Run Code Online (Sandbox Code Playgroud) 我想在按下"Do Some Work"按钮但是在调用任何聚焦TextInput的onBlur事件之后执行一些任务.
这是我的示例代码: -
'use strict';
var React = require('react-native');
var {AppRegistry,View,Text,ScrollView,TextInput,TouchableOpacity} = React;
var MyApp = React.createClass({
doSomeWork: function () {
console.log("doSomeWork called....");
},
render: function () {
return (
<View>
<TouchableOpacity style={{padding:10,alignItems:"center",backgroundColor:"blue"}}
onPress={this.doSomeWork}>
<Text>Do Some Work</Text>
</TouchableOpacity>
<View style={{height:400}}>
<ScrollView keyboardShouldPersistTaps={true}>
<View>
<TextInput ref="first" onBlur={()=>{console.log("TextInput 1 blurred....")}}/>
</View>
<View>
<TextInput ref="second" onBlur={()=>{console.log("TextInput 2 blurred....")}}/>
</View>
<View>
<TextInput ref="third" onBlur={()=>{console.log("TextInput 3 blurred....")}}/>
</View>
</ScrollView>
</View>
</View>
);
}
});
AppRegistry.registerComponent('nativeApp', () => MyApp);
Run Code Online (Sandbox Code Playgroud)
我试着打电话
this.refs.first.blur()
Run Code Online (Sandbox Code Playgroud)
手动,但这是在异步,我不知道TextInput的事件是否已调用.
任何帮助将不胜感激.