我想尝试在CodePen中使用React,但是我无法对其进行设置。
我的JS看起来像这样:
<div id="app"></app>
我的html看起来像这样:
<!DOCTYPE html>
<html>
<head>
<base href="https://demos.telerik.com/kendo-ui/scheduler/events">
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.mobile.min.css" />
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.timezones.min.js"></script>
<link rel="stylesheet" href="../content/shared/styles/examples-offline.css">
<script src="../content/shared/js/console.js"></script>
</head>
<body>
<div id="example">
<button onclick="prev()">Previous</button>
<button onclick="next()">Next</button>
<div id="scheduler"></div>
</div>
<script>
$("#scheduler").kendoScheduler({
dataSource: [
{
id: 1,
start: new Date("2013/6/6 08:00 AM"),
end: new Date("2013/6/6 09:00 AM"),
title: "Interview"
}
]
});
function next() {
let scheduler = $("#scheduler").data("kendoScheduler");
let date = scheduler.date();
date.setDate(date.getDate() + 1);
scheduler.date(date);
}
function prev() {
let scheduler = $("#scheduler").data("kendoScheduler");
let date = scheduler.date();
date.setDate(date.getDate() - 1);
scheduler.date(date);
}
</script>
</body>
</html>
我如下图所示导入React和ReactDom,但是出现错误“未定义ReactDom”。
有人知道如何设置吗?
答案 0 :(得分:2)
这是一个错字错误。您应该使用ReactDOM而不是ReactDom。