當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript react.DOM類代碼示例

本文整理匯總了TypeScript中react.DOM的典型用法代碼示例。如果您正苦於以下問題:TypeScript DOM類的具體用法?TypeScript DOM怎麽用?TypeScript DOM使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DOM類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
            }
開發者ID:zichun,項目名稱:multiplayr,代碼行數:31,代碼來源:rockscissorspaper.ts

示例2: 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)))
    }
開發者ID:duncanmak,項目名稱:experiments,代碼行數:9,代碼來源:github-events.ts

示例3: render

function render() {
    ReactDOM.render(
        React.DOM.text(42),
        valueEl
    )
    //valueEl.innerHTML = store.getState().toString()
}
開發者ID:dmitry-a-morozov,項目名稱:Sandbox,代碼行數:7,代碼來源:app.ts

示例4: 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]));
                    }
                });
開發者ID:zichun,項目名稱:multiplayr,代碼行數:18,代碼來源:rockscissorspaper.ts

示例5: function

 render: function () : void {
     return D.div({},
                  D.span({ onMouseUp: this.handleNameClick }, this.props.name),
                  ": ",
                  React.DOM.input({ type: "text",
                                    ref: "input",
                                    onChange: this.doUpdate,
                                    defaultValue:
                                    this.props.backing.textContent,
                                    id: this.props.parent.getName() + "-" +
                                    this.props.name })
                 );
 }
開發者ID:,項目名稱:,代碼行數:13,代碼來源:


注:本文中的react.DOM類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。