我正在尝试研究剑道反应 DropDownList 的基本示例。这是我的代码
import React, { useState } from "react";
import "./App.css";
import { DropDownList } from "@progress/kendo-react-dropdowns";
function App() {
const sizes = ["X-Small", "Small", "Medium", "Large", "X-Large", "2X-Large"];
const [value, setValue] = useState("X-Small");
const handleChange = (event) => {
setValue(event.target.value);
};
return (
<div>
<div>T-shirt size:</div>
<DropDownList
data={sizes}
value={value}
onChange={handleChange}
style={{
width: "300px",
}}
>
Choose One
</DropDownList>
</div>
);
}
export default App;
我的app.css如下
.App {
display: block;
width: 100%;
height: 100%;
overflow: auto;
min-height: 80px;
box-sizing: border-box;
padding: 30px;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: inline-block;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.k-dropdown .k-dropdown-wrap {
height: 26px;
width: 250px;
}
.k-dropdown-wrap .k-input {
line-height: 22px;
}
.k-dropdown-wrap .k-icon {
position: relative;
top: -4px;
}
.k-input,
.k-picker {
display: inline-flex;
}
.k-dropdown {
display: block;
width: 250px;
}
element.style {
display: block;
}
但是当我运行它时,我看到下拉选项的文本旁边是一个看起来像空按钮的东西。
知道发生了什么事吗?我什至尝试过完全删除 css,但它就是这样呈现的。网上所有的例子都像这样很基础。