1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import React, { Component, Fragment } from "react" ; import "antd/dist/antd.css" ; import { Input } from "antd" ; export default class TodoList extends Component { constructor(props) { super (props); this .state = {}; } render() { return ( <Fragment> <div> <Input placeholder= "前端架构师发现新大陆" style={{ width: "300px" , border: "1px solid #50eace" }} /> </div> </Fragment> ); } } |
如果不写import { Input } from "antd";就不会报错,很奇怪