本文整理汇总了TypeScript中react.DOM.div方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOM.div方法的具体用法?TypeScript DOM.div怎么用?TypeScript DOM.div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类react.DOM
的用法示例。
在下文中一共展示了DOM.div方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: render
public render() {
const mp = this.props.MP;
const choice = this.props.choice;
const choices = choiceEnum;
const reactChoices = [];
forEach(choices, (c) => {
if (choice === c) {
reactChoices.push(React.DOM.div({className: 'choice selected'},
choices[c]));
} else {
let oc = null;
if (choice === -1) {
oc = ((c) => {
return () => {
mp.move(c);
};
})(c);
}
reactChoices.push(React.DOM.div({className: 'choice', onClick: oc},
choices[c]));
}
});
const cn = choice === -1 ? 'unselected' : 'selected';
reactChoices.push(React.DOM.div({className: 'clearer'}));
return React.DOM.div({id: 'choices', className: cn}, reactChoices);
}
示例2: forEach
forEach(choices, (c) => {
if (choice === c) {
reactChoices.push(React.DOM.div({className: 'choice selected'},
choices[c]));
} else {
let oc = null;
if (choice === -1) {
oc = ((c) => {
return () => {
mp.move(c);
};
})(c);
}
reactChoices.push(React.DOM.div({className: 'choice', onClick: oc},
choices[c]));
}
});
示例3: render
render() {
let style = { float: 'left', width: '500px' };
let { state } = this.props;
return DOM.div(
{ style },
DOM.label({}, `${this.props.name} ${this.props.data.length}`),
DOM.ol({}, this.props.data.map(this.renderItem)))
}
示例4: render
render(){
return React.DOM.div(null, React.DOM.textarea({
defaultValue: this.props.text
}), React.DOM.h3(null, this.props.text.length));
}
示例5: render
render() { return DOM.div({}, "Hello"); }
示例6: renderItem
renderItem(i: any, key: number) {
return DOM.li({ key },
DOM.b({}, i.type),
DOM.a({ href: i.repo.url }, i.repo.name),
DOM.div({}, i.created_at) );
}
示例7: render
render(){
return React.DOM.div(null, React.DOM.textarea({
value: this.state.text,
onChange: this.textChange.bind(this)
}), React.DOM.h3(null, this.state.text.length));
}