Material-UI使用 1、安装npm install mui/material emotion/react emotion/styled npm install mui/x-data-grid2、表格使用DataGrid组件时其模型中需要有属性id有CheckBox时使用onSelectionModelChange方法来监听选择的变化。返回的新选择模式是属性id3、时间轴组件需要安装mui/labnpm install mui/lab4、MUI System(v9.2)4.1 styled方法输入为tag, inputOptions {}taginputOptions输出为函数muiStyledResolver其输入为expressionsInput返回值为Componentconst muiStyledResolver (...expressionsInput) { const expressionsHead []; const expressionsBody expressionsInput.map(transformStyle); const expressionsTail []; // Preprocess props to set the scoped theme value. // This must run before any other expression. expressionsHead.push(styleAttachTheme); if (componentName overridesResolver) { expressionsTail.push(function styleThemeOverrides(props) { const theme props.theme; const styleOverrides theme.components?.[componentName]?.styleOverrides; if (!styleOverrides) { return null; } const resolvedStyleOverrides {}; // TODO: v7 remove iteration and use resolveStyleArg(styleOverrides[slot]) directly // eslint-disable-next-line guard-for-in for (const slotKey in styleOverrides) { resolvedStyleOverrides[slotKey] processStyle( props, styleOverrides[slotKey], props.theme.modularCssLayers ? theme : undefined, ); } return overridesResolver(props, resolvedStyleOverrides); }); } if (componentName !skipVariantsResolver) { expressionsTail.push(function styleThemeVariants(props) { const theme props.theme; const themeVariants theme?.components?.[componentName]?.variants; if (!themeVariants) { return null; } return processStyleVariants( props, themeVariants, [], props.theme.modularCssLayers ? theme : undefined, ); }); } if (!skipSx) { expressionsTail.push(styleFunctionSx); } // This function can be called as a tagged template, so the first argument would contain // CSS string[] values. if (Array.isArray(expressionsBody[0])) { const inputStrings expressionsBody.shift(); // We need to add placeholders in the tagged template for the custom functions we have // possibly added (attachTheme, overrides, variants, and sx). const placeholdersHead new Array(expressionsHead.length).fill(); const placeholdersTail new Array(expressionsTail.length).fill(); let outputStrings; // prettier-ignore { outputStrings [...placeholdersHead, ...inputStrings, ...placeholdersTail]; outputStrings.raw [...placeholdersHead, ...inputStrings.raw, ...placeholdersTail]; } // The only case where we put something before attachTheme expressionsHead.unshift(outputStrings); } const expressions [...expressionsHead, ...expressionsBody, ...expressionsTail]; const Component defaultStyledResolver(...expressions); if (tag.muiName) { Component.muiName tag.muiName; } if (process.env.NODE_ENV ! production) { Component.displayName generateDisplayName(componentName, componentSlot, tag); } return Component; };5、组件(v4)5.1 Card卡片集成内容和操作CardContentCardActions参考资料安装 - MUIGitHub - mui-org/material-ui at v5.1.0

相关新闻

最新新闻

3步掌握PUBG-Logitech:开源智能识别压枪工具的完整教程

3步掌握PUBG-Logitech:开源智能识别压枪工具的完整教程

3步掌握PUBG-Logitech:开源智能识别压枪工具的完整教程 【免费下载链接】PUBG-Logitech PUBG罗技鼠标宏自动识别压枪 项目地址: https://gitcode.com/gh_mirrors/pu/PUBG-Logitech PUBG-Logitech是一款基于图像识别技术的开源罗技鼠标宏压枪工具,…

2026/8/3 20:09:51
YOLOv11改进 | 主干/Backbone篇 | 目标检测网络FasterNeT轻量化网络助力yolov11改进(提高FPS和检测效率)

YOLOv11改进 | 主干/Backbone篇 | 目标检测网络FasterNeT轻量化网络助力yolov11改进(提高FPS和检测效率)

一、本文介绍 本文给大家带来的改进机制是FasterNet网络,将其用来替换我们的特征提取网络,其旨在提高计算速度而不牺牲准确性,特别是在视觉任务中。它通过一种称为部分卷积(PConv)的新技术来减少冗余计算和内存访问。这种方法使得FasterNet在多种设备上运行速度比其他网络…

2026/8/3 20:09:51
Vue Router导航守卫重定向死循环:原理、调试与最佳实践

Vue Router导航守卫重定向死循环:原理、调试与最佳实践

1. 项目概述:导航守卫中的重定向死循环 在Vue.js的单页应用开发中, vue-router 的导航守卫(Navigation Guards)是实现路由权限控制、数据预加载和页面跳转逻辑的核心机制。然而,许多开发者,包括我自己&am…

2026/8/3 20:09:51
嵌入式开发

嵌入式开发

文章目录零、学习大纲一、嵌入式驱动开发1.具体情况2.RTOS:FreeRTOS二、Linux驱动开发零、学习大纲 了解GPIO协议、I2C协议、SPI Flash、WatchDog、FreeRTOS、CAN总线、串口编程 一、嵌入式驱动开发 1.具体情况 1.就业单位: (1)主控芯片原厂&#xff…

2026/8/3 20:09:51
行为树实战:从状态机到py_trees,掌握AI决策核心与Fallback节点精髓

行为树实战:从状态机到py_trees,掌握AI决策核心与Fallback节点精髓

1. 从状态机到行为树:为什么我们需要更灵活的决策逻辑如果你做过机器人、游戏AI或者任何需要复杂行为逻辑的项目,大概率用过状态机。状态机是个好东西,它把行为拆分成一个个离散的状态,通过事件触发状态转移,逻辑清晰&…

2026/8/3 20:09:51
Windows 11下Miniconda安装与配置全攻略:从环境变量到虚拟环境管理

Windows 11下Miniconda安装与配置全攻略:从环境变量到虚拟环境管理

1. 从一次失败的安装说起:为什么你的Miniconda总出问题? 如果你在Windows 11上安装Miniconda,大概率会遇到两个经典场景:要么是安装后打开Anaconda Prompt一片空白,敲命令毫无反应;要么是兴冲冲地在VSCode里…

2026/8/3 20:04:51