亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? ? ????? JS ???? MUI ?? ??: ?? React UI ??? ?? ??? ???

MUI ?? ??: ?? React UI ??? ?? ??? ???

Dec 29, 2024 pm 05:53 PM

MUI ???? ??

MUI(Material-UI)? ???? ???? ????? ???? ? ?????? ??? ????? ?? ?? React UI ????????. ?? ??, Stack, Select, Card, Accordion, ??? ? ??, MUI ??? ???? ???? ????? ?? ??? ?????.

? ?????? ??? ?? ??? ????? ???? ???? ? ??? ?? ?? ?? ?? ??? ?? ??? ????? ???? ?? ???? ??? ?????. ????? ??? ????? ? ??? ?? MUI? ? ??? ?? ??? ?? ? ????.

?? ??

MUI ?? ??? ???? ?? ?? ??? ?????? ?????. ? ?????? ??? React? ?? ???? ??? ?? ?? React ??????? ????? ?????. ?? ????? ? ??? ??? ??? ????? ????? ????? ?? ?? ?? ???

Vite? ??? ???. React? Vite? ???? ??? ??? ???? ?? React? Vite ?? ???? ?????.

?? ?????

Material-UI(MUI)? ???? ??? ?????. ?? ??? ???? ???:

npm install @mui/material @emotion/react @emotion/styled
React ??????? ???? ?? ??? MUI ?????

?? ??

MUI(Material-UI)? ??????? ?? ?? ???? ??? ???? ???? ??? ?? ???? ?????. ?? ??? ??, ???, ?? ?? ???? ???? ??? ????.

MUI?? ?? ??? ???? ??? ??? ????.

  1. ?? ???? ????: createTheme? ???? ??? ?? ??? ???? ThemeProvider? ????? ?????.

  2. ?? ??: ???, ?????? ? ?? ??? ??? ?? ?? ?????.

  3. ?????? ??: ThemeProvider? ???? ?? ??? ?? ??? ??? ?????.

?: ??? ?? ?? ?? ? ??

import React from 'react';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Button } from '@mui/material';

// Define a custom theme
const theme = createTheme({
  palette: {
    primary: {
      main: '#1976d2', // Primary color
    },
    secondary: {
      main: '#dc004e', // Secondary color
    },
  },
  typography: {
    fontFamily: 'Roboto, Arial, sans-serif',
  },
});

function App() {
  return (
    <ThemeProvider theme={theme}>
      <Button variant="contained" color="primary">
        Primary Button
      </Button>
      <Button variant="outlined" color="secondary">
        Secondary Button
      </Button>
    </ThemeProvider>
  );
}

export default App;
??? ?? ?:

  • ?? ??: ???? ???? ?? ?? ??? ??? ???? ? ?? ??? ?? ??? ?????.
  • sx Prop ??: ?? ???? ?? ??? ??? ?? MUI? sx Prop? ???? ??? ????? ???? ????? ???? ? ????.
??? ???? ??? ??? ????? ???? ???? ? ??? ?? ?? ????? ???? ? ????.

?? MUI ?? ??

MUI? UI ??? ????? ?? ??? ?? ??? ?????. ????? ?? ????? ???? ?? ??, ?? ??? ? ??? ?? ??? ?????.

1. MUI ????

????? ?? ??? ??? ??? ???? ??? ??? ??????.

?? ?:

npm install @mui/material @emotion/react @emotion/styled

?? ??:

  • freeSolo? ???? ???? ??????.
  • groupBy? ??? ?? ??.
  • ???? ?? ???? ??? ?????.

MUI Components: Your Complete Guide to Building Modern React UIs

2. MUI ??

??? ?? ??? 1?? ????(?? ?? ??)?? ?????.

?? ?:

import React from 'react';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Button } from '@mui/material';

// Define a custom theme
const theme = createTheme({
  palette: {
    primary: {
      main: '#1976d2', // Primary color
    },
    secondary: {
      main: '#dc004e', // Secondary color
    },
  },
  typography: {
    fontFamily: 'Roboto, Arial, sans-serif',
  },
});

function App() {
  return (
    <ThemeProvider theme={theme}>
      <Button variant="contained" color="primary">
        Primary Button
      </Button>
      <Button variant="outlined" color="secondary">
        Secondary Button
      </Button>
    </ThemeProvider>
  );
}

export default App;

?? ??:

  • ??(?, ?) ? ??? ?????.
  • ?? ????? ?? ??? ??? ?????.

MUI Components: Your Complete Guide to Building Modern React UIs

3. MUI ??

??? ??? ??? ?? ???? ?? ?????.

?? ?:

import React from 'react';
import { Autocomplete, TextField } from '@mui/material';

const options = ['Option 1', 'Option 2', 'Option 3'];

function AutocompleteExample() {
  return (
    <Autocomplete
      options={options}
      renderInput={(params) => <TextField {...params} label="Select an Option" />}
    />
  );
}

export default AutocompleteExample;

?? ??:

  • CardMedia? ???? ???? ?????.
  • CardActions? ??? ?????.

MUI Components: Your Complete Guide to Building Modern React UIs

5. MUI ????

Accordion? FAQ? ?? ?? ??? ??? ?????.

?? ?:

import React from 'react';
import { Stack, Button } from '@mui/material';

function StackExample() {
  return (
    <Stack direction="row" spacing={2}>
      <Button variant="contained">Button 1</Button>
      <Button variant="outlined">Button 2</Button>
    </Stack>
  );
}

export default StackExample;

?? ??:

  • ??? ???? ?? ? onChange? ?????.
  • disableGutters? ???? ??? ?????.

MUI Components: Your Complete Guide to Building Modern React UIs

6. MUI ???

???? ???? ?? ??? ????? ?????.

?? ?:

import React, { useState } from 'react';
import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';

function SelectExample() {
  const [value, setValue] = useState('');

  const handleChange = (event) => setValue(event.target.value);

  return (
    <FormControl fullWidth>
      <InputLabel>



<p><strong>Customization:</strong>  </p>

<ul>
<li>Enable multiple selections with multiple.
</li>
<li>Render custom items with renderValue.</li>
</ul>

<p><img src="/static/imghw/default1.png"  data-src="https://img.php.cn/upload/article/000/000/000/173546599689834.jpg"  class="lazy" alt="MUI Components: Your Complete Guide to Building Modern React UIs" /></p>

<h4>
  
  
  <strong>4. MUI Card</strong>
</h4>

<p>Card displays structured content like text, images, and actions.</p>

<p><strong>Basic Example:</strong><br>
</p>

<pre class="brush:php;toolbar:false">import React from 'react';
import { Card, CardContent, Typography } from '@mui/material';

function CardExample() {
  return (
    <Card>
      <CardContent>
        <Typography variant="h5">Card Title</Typography>
        <Typography variant="body2">Card Content</Typography>
      </CardContent>
    </Card>
  );
}

export default CardExample;

?? ??:

  • ??? ???? ?????.
  • sx? ???? ?? ?? ?? ??? ?? ???? ?????.

![MUI ???(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6oockmr57d8wgj659hy.png)

7. MUI ??

??? ????? ???? ???? ??? ???????.

?? ?:

import React from 'react';
import { Accordion, AccordionSummary, AccordionDetails, Typography } from '@mui/material';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

function AccordionExample() {
  return (
    <Accordion>
      <AccordionSummary expandIcon={<ExpandMoreIcon />}>
        <Typography>Accordion Title</Typography>
      </AccordionSummary>
      <AccordionDetails>
        <Typography>Accordion Content</Typography>
      </AccordionDetails>
    </Accordion>
  );
}

export default AccordionExample;

?? ??:

  • ?? ??? ??? ?????.
  • ???? ???? ? ??? ??? ?????.

MUI Components: Your Complete Guide to Building Modern React UIs

??? ?? MUI ?? ??? ????? ???? ??? ?????? ??? ?? ??? ?????. ??? ?? ??? ?? ??? ?? ???? ?? ??? ?? ?? ??? ? ????.

MUI ?? ?? ??? ?? ?? ??

Material-UI(MUI)? ???? ????? ???? ?? ???? ?????? ?? ?? ??? ?????.

1. ???? ?? ?? ??

  • ??: MUI? ?? ???? ???? ???? ???? ???? ??? ???? ???? ?? ??? ?????.
  • ??: createTheme? ???? ??? ?? ??? ???? ThemeProvider? ???? ????? ?????. ??? ?? ?? ?? ???? ??, ??? ? ??? ???? ?????.
  • ?: ??? ???? ?????? ??? ?? ?? ? ?? ???? ?????? ???? ?????.

2. ?? ??? ??? ?? sx Prop? ?????

  • ??: sx prop? ?? CSS ?? ?? ?? ??? ?? ???? ???? ??? ??? ?????.
  • ??: ??? ??? ???? ?? ??? ?? ?? ?? ?? ?? sx prop? ?????.
  • ?:
npm install @mui/material @emotion/react @emotion/styled

3. ?? ???? ?? ???

  • ??: ?? ??? ??? ?? ????? ????? ?? ?? ??? ?????.
  • ??: React?lazy() ? Suspense? ???? ??? ?? MUI ?? ??? ?????.
  • ?:
import React from 'react';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Button } from '@mui/material';

// Define a custom theme
const theme = createTheme({
  palette: {
    primary: {
      main: '#1976d2', // Primary color
    },
    secondary: {
      main: '#dc004e', // Secondary color
    },
  },
  typography: {
    fontFamily: 'Roboto, Arial, sans-serif',
  },
});

function App() {
  return (
    <ThemeProvider theme={theme}>
      <Button variant="contained" color="primary">
        Primary Button
      </Button>
      <Button variant="outlined" color="secondary">
        Secondary Button
      </Button>
    </ThemeProvider>
  );
}

export default App;

4. ???? ?? ??? ???? ?????

  • ??: ??? ????? ?? ???? ??? ??? ??? ?????.
  • ??: xs, sm, md ?? ?? ???? ?? ?? ?? ?? ??? ??? ?? sx prop? ?????.
  • ?:
import React from 'react';
import { Autocomplete, TextField } from '@mui/material';

const options = ['Option 1', 'Option 2', 'Option 3'];

function AutocompleteExample() {
  return (
    <Autocomplete
      options={options}
      renderInput={(params) => <TextField {...params} label="Select an Option" />}
    />
  );
}

export default AutocompleteExample;

5. ??? ???? ??? ????

  • ??: sx prop? ????? ??? ??? ???? ??? ???? ??? ???? ???? ? ????.
  • ??: ??? ???? ???? ???? ?? makeStyles ?? ??? API? ?????.

6. ?? ??? ?? ?? ?? API ????

  • ??: MUI ?? ??? ?? ??? ??? ??? ???? API? ?????.
  • ??: MUI ??? ????? ???? ?? ??? ?? Select? MenuProps ?? Autocomplete? renderInput? ?? ??? ?????.

7. ??? ??(A11y)

  • ??: ???? ?? ??? ?? ???? ??? ?? ???? ??????? ??? ? ????.
  • ??: ??? HTML ? aria-* ??? ?? ??? ??? ?????. ?? ?? Accordion? aria-expanded? ????? ?? ?? ??? aria-labelledby? ?????.

8. ?? ? ???? ?? ???

  • ??: ?? MUI ?? ??? ?? ??? ???????? ??? ??? ??? ?? ? ????.
  • ??: React DevTools ? Lighthouse? ?? ??? ???? ??? ???? ?? ??? ?????.

9. MUI ??? ?? ??? ?????

  • ??: MUI? ????? ??? ??? ?? ??? ????? ????? ?? ?????.
  • ??: ?? ???? ????, ?? ??, ? ???? ????? ?????.

10. ???? ?? ?? ?? ???

  • ??: ?? ??? ????? ?? ??? ???? ???? ?????.
  • ??: ?? UI ??? ??? ??? ????(?: ??, ??, ??)? ????? ???? ??? ?????.

??? ?? ??? ??? MUI? ???? ??? ????? ????? ?? ???? ?? ??? ??? ??????? ??? ? ????.

??

MUI(Material-UI) ?? ??? ???? ??? ?? ? ??????? ??? ?? ???? ???? ????? ??????. ? ???? ??? ?? ??? ??? ??? ??? ????? ???? ??? ???? ??? ??? ?? ??? ?????? ?? ? ????. ????? ??? ????? MUI? React ????? ????? ???? ? ?? ??? ?????.

? ??? MUI ?? ??: ?? React UI ??? ?? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
NYT ?? ??? ??
130
836
???
??? ??? JavaScript?? ??? ?????? ??? ??? JavaScript?? ??? ?????? Jul 04, 2025 am 12:42 AM

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

node.js?? HTTP ????? ??? node.js?? HTTP ????? ??? Jul 13, 2025 am 02:18 AM

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ?? : ?? ? ?? JavaScript ??? ?? : ?? ? ?? Jul 13, 2025 am 02:43 AM

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

JavaScript Time Object, ??? Google Chrome? EACTEXE, ? ?? ? ???? ?????. JavaScript Time Object, ??? Google Chrome? EACTEXE, ? ?? ? ???? ?????. Jul 08, 2025 pm 02:27 PM

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

REACT vs Angular vs Vue : ?? JS ??? ??? ?? ????? REACT vs Angular vs Vue : ?? JS ??? ??? ?? ????? Jul 05, 2025 am 02:24 AM

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

JavaScript?? ?? ?? ??? (IIFE)? ????? JavaScript?? ?? ?? ??? (IIFE)? ????? Jul 04, 2025 am 02:42 AM

iife (?? invokedfunctionexpression)? ?? ??? ???? ?? ????? ??? ???? ?? ??? ????? ?? ??? ? ?????. ??? ?? ?? ??? ???? ? ?? ??? ??? ?? (function () {/code/}) ();. ?? ???? ??? ?????. 1. ?? ??? ??? ?? ???? ?? ??? ??? ?????. 2. ?? ??? ??? ???? ?? ?? ??? ????. 3. ?? ?? ??? ????? ?? ???? ???????? ?? ? ??. ???? ?? ???? ?? ??? ES6 ??? ??? ??? ?? ? ??? ????? ??? ? ???? ???????.

?? API? ???? ??? ???? ??? ?????? ?? API? ???? ??? ???? ??? ?????? Jul 08, 2025 am 02:43 AM

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.

?? ??? : JavaScript? ??, ?? ?? ? ?? ????? ?? ??? : JavaScript? ??, ?? ?? ? ?? ????? Jul 08, 2025 am 02:40 AM

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

See all articles