React.createClass编译时报错TypeError

https://img1.mukewang.com/5c80c4fe0001998108000185.jpg

一个很简单的ajax例子代码如下:

index.js:


import React from 'react';

import ReactDOM from 'react-dom';


var ajaxdemo = require('./AjaxDemo.js');

ajaxdemo.AjaxDemo();

AjaxDemo.js:

https://img.mukewang.com/5c80c51500012f8c10670863.jpg

index.html:


<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <meta name="theme-color" content="#000000">

    <link rel="manifest" href="../manifest.json">

    <link rel="shortcut icon" href="../favicon.ico">

    <title>React App</title>

  </head>

  <body>

    <div id="ajaxdemo"></div>

  </body>

</html>


阿波罗的战车
浏览 687回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript