我正在尝试为其父路由中的一个子路由创建索引路由,但我不断收到错误消息,提示类型“true”不可分配给类型“false |” 不明确的'。我如何解决它?
<Routes>
<Route path="/" element={<Profile />}>
<Route index path="/username" element={<ProfileDetails />} />
<Route path="settings/profile" element={<EditProfile />} />
</Route>
<Route path="/login" element={<Login />} />
<Route path="/register" element={<SignUp />} />
</Routes>
Run Code Online (Sandbox Code Playgroud)
我试图让用户使用鼠标在画布上绘制矩形,并且我已经能够在一定程度上使其工作。用户可以使用鼠标绘制矩形,但它仅在 mouseup 事件之后显示,但我也希望用户在鼠标移动事件上绘制矩形时也能看到矩形。我怎样才能实现这一点,同时让用户绘制多个当前有效的矩形,但我希望他们在绘制矩形时看到它。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
#container {
/*background-color: lime;*/
width: 150px;
height: 150px;
cursor: pointer;
}
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
#heatmapContainer {
border: 1px solid red;
}
</style>
</head>
<body>
<div class="heatmapWrapper">
<div id="heatmapContainer" style="height: 4205px; width: 1278px">
<div id="heatmap1" class="heatmapTile" style="height: 4205px; position: relative">
<canvas …Run Code Online (Sandbox Code Playgroud)