);
// good
var multilineJsx = (
);
// good
return (
);
单行 JSX 省略 ()。
var singleLineJsx =
Simple JSX
;
// good, when single line
render() {
const body =
hello
;
return {body};
}
8.自闭合标签
JSX 中所有标签必须闭合;
没有子元素的组件使用自闭合语法,自闭合标签 / 前留一个空格。
// bad
// very bad
// bad
// good
9.组件内部代码组织
不要使用下划线前缀命名 React 组件的方法;
// bad
React.createClass({
_onClickSubmit() {
// do stuff
}
// other stuff
});
// good
React.createClass({
onClickSubmit() {
// do stuff
}
// other stuff
});
按照生命周期组顺序织组件的方法、属性;
方法(属性)之间空一行;
.render() 方法始终放在最后;
自定义方法 React API 方法之后、.render() 之前。
// React 组件中按照以下顺序组织代码
React.createClass({
displayName: '',
mixins: [],
statics: {},
propTypes: {},
getDefaultProps() {
// ...
},
getInitialState() {
// do something
},
componentWillMount() {
// do something
},
componentDidMount() {
// do something: add DOM event listener, etc.
},
componentWillReceiveProps() {
},
shouldComponentUpdate() {},
componentWillUpdate() {},
componentDidUpdate() {},
componentWillUnmount() {
// do something: remove DOM event listener. etc.
},
// clickHandlers or eventHandlers like onClickSubmit() or onChangeDescription()
handleClick() {
// ...
},
// getter methods for render like getSelectReason() or getFooterContent()
// Optional render methods like renderNavigation() or renderProfilePicture()
render() {
// ...
}
});
--只包含执行部分的PL/SQL块
--set serveroutput off
begin
dbms_output.put_line('Hello,everyone!');
end;
select * from emp;
--包含定义部分和执行部分的PL/SQL块
declare
v_ename varchar2(5);
begin
select
转:http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
maven报错:
Plugin execution not covered by lifecycle configuration:
要使用MonkeyRunner,就要学习使用Python,哎
先抄一段官方doc里的代码
作用是启动一个程序(应该是启动程序默认的Activity),然后按MENU键,并截屏
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRun