每个平台的下载地址格式:
查看 VSCode 现有版本号列表: microsoft/vscode/tags
Live Editor
function render() {const [list, setList] = useState([]);useEffect(() => {fetch("/data/vscode-platforms.json").then(response => response.json()).then(data => {setList(data);})}, []);const [ version, setVersion ] = useState("1.81.0");return (<table><thead><tr><td colSpan="2"> 输入版本号: <input type="text" value={version} onChange={e => setVersion(e.target.value)} /> </td></tr><tr><th>平台</th><th>下载地址</th></tr></thead><tbody>{list.map(item => (<tr key={item.platform}><td> { item.platform } </td><td> {version? <a target="_blank" href={item.link.replace("{version}", version)}>{item.link.replace("{version}", version)}</a>: item.link } </td></tr>))}</tbody></table>);}
Result
Loading...