繁体   English   中英

如何使用materialize-css进行反应并保持materialize-css的已安装组件的大小最小化

[英]how to use materialize-css with react and keeping the size of installed components of materialize-css to be minimum

我想在我的React项目中使用materialize-css。 如何设置materialize-css并将其与React一起使用?

可以使用https://github.com/react-materialize/react-materialize

npm install react-materialize

将这些添加到您需要Material Design的默认html页面。

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="path/to/materialize.css">
  </head>
  <body>
    <script src="path/to/materialize.js"></script>
    <script src="path/to/your/bundle.js"></script>
  </body>
</html>

使用组件。

import { Button, Card, Row, Col } from 'react-materialize';

此处列出了完整列表以及如何实现组件: http//react-materialize.github.io

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM