同样的两种使用方式
1.模块安装
npm install @material-ui/core
2.CDN 引用
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
引用方式还是,同原来的一样,
import React from 'react';
import { Button } from '@material-ui/core';
function App() {
return <Button color="primary">Hello World</Button>;
}
Material-UI是需要一个个引入的
但是在使用的时候,也并是如element ui
因为jsx配合React ,所导致的繁杂性,我们必须使用新的解决技术