08 November 2016

環境

  • VS2013
  • React V.14.7

Skill

操作步驟

  • Create Project

    0001

    0002

  • Add Home Controller

    0003

  • Add View

    0004

  • Nuget Install React JS

    0005

  • View Include React js

      <script src="~/Scripts/react/react.js"></script>
      <script src="~/Scripts/react/react-dom.js"></script>
    
  • View Add Html & Script

      <div id="root">
          <!-- This div's content will be managed by React. -->
      </div>
      <script>
          var Message = React.createClass({
              render: function () {
                  return (React.createElement("h3", null, "Hello, world!"));
              }
          });
          ReactDOM.render(React.createElement(Message, null), document.getElementById('root'));
      </script>
    
  • View JS & Result

    0006

    0007



blog comments powered by Disqus