我是编程和剑道的新手。我编写了一些简单的代码来使用 Kendo React 生成一个下拉列表,其中我对值进行了硬编码 -
import React, { Component } from 'react';
import { DropDownList } from '@progress/kendo-react-dropdowns';
import '@progress/kendo-theme-default/dist/all.css';
import './App.css';
class App extends Component {
services = [ "Oxygen Therapy", "CPAP-DME Reimbursement", "Empty Deck Maker" ];
render() {
return (
<div>
<h2>Select CDS Service</h2>
<DropDownList data={this.services} />
</div>
);
}
}
export default App;
-- 现在我需要在通过 URL 传递给我的 JSON 文件中使用“title”值,但我不知道从哪里开始。这是 JSON 的示例 -
{
"services": [
{
"id": "empty-deck-create",
"title": "Empty Deck Maker",
"description": "Generates an empty card deck",
"hook": "empty-deck-create"
}
]
}