React本地环境没有报错,后端部署到环境测试后就报错
项目中只是用了 fullcalendar这个日历插件后就有这个错
import React, { useEffect, useState } from "react";
import FullCalendar from "@fullcalendar/react";
import locale from "@fullcalendar/core/locales/zh-cn"; // 中文
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import { Button, message } from "antd";
import { serviceGetEqDeviceMaintPlanCalendar } from "@/services";
import "./index.scss";
// import "@fullcalendar/react/dist/vdom";
type Props = {
setTabToggle: any;
};
const PlanCalendar: React.FC<Props> = function ({ setTabToggle }) {
const [sourceList, setSourceList] = useState([]);
const [getcalendarLoading, setGetcalendarLoading] = useState(false);
const calendarContext = () => {
serviceGetEqDeviceMaintPlanCalendar()
.then((res: any) => {
if (res.data.Tag) {
setSourceList(res.data.Data);
} else if (res.data.Message) {
message.error(res.data.Message);
}
})
.catch((err: any) => {
console.log(err);
})
.finally(() => {
setGetcalendarLoading(false);
});
};
useEffect(() => {
calendarContext();
}, []);
const onCancelPlan = (value: any) => {
setTabToggle(value);
};
return (
<div className="total
<FullCalendar
plugins={[dayGridPlugin, timeGridPlugin]}
initialView="dayGridMonth"
headerToolbar={{
left: "prevYear,prev,next,nextYear today",
center: "title",
right: "timeGridWeek,dayGridMonth,timeGridYear",
}}
buttonText={{
today: "今天",
week: "周",
month: "月",
year: "年",
}}
events={sourceList}
height="95%"
locale={locale}
/>
</div>
);
};
export default React.memo(PlanCalendar);
我找了大小写,但是没有写错的,现在我也不知道为什么回报这个错了
下面是插件的版本
"@fullcalendar/core": "^5.5.1",
"@fullcalendar/daygrid": "^5.5.0",
"@fullcalendar/react": "^5.5.0",
"@fullcalendar/timegrid": "^5.5.1",
相似问题