React Native【详解】动画

基础动画的实现流程

  1. 使用支持动画的组件

          <Animated.Viewstyle={[{opacity: fadeAnim, // 绑定透明度动画值},]}><Text>动画元素</Text></Animated.View>
    
    • Animated.View:用于创建动画容器,支持所有 View 的属性。
    • Animated.Text:用于创建文本动画,支持所有 Text 的属性。
    • Animated.Image:用于创建图片动画,支持所有 Image 的属性。
    • Animated.ScrollView:用于创建滚动视图动画,支持所有 ScrollView 的属性。
    • Animated.FlatList:用于创建列表动画,支持所有 FlatList 的属性。
    • Animated.SectionList:用于创建列表动画,支持所有 SectionList 的属性。
  2. 导入 Animated

    import {Animated
    } from "react-native";
    
  3. 声明动画变量

      // 透明度动画值const fadeAnim = useState(new Animated.Value(0))[0]; // 初始值为0(完全透明)
    

      // 透明度动画值const fadeAnim = useRef(new Animated.Value(0)).current; // 初始值为0(完全透明)
    
  4. 执行动画

      // 淡入动画函数const fadeIn = () => {Animated.timing(fadeAnim, {toValue: 1, // 目标值为1(完全不透明)duration: 1000, // 动画持续时间1秒useNativeDriver: false, // 是否启用原生动画驱动,建议不使用}).start();};
    

动画的启动 start

通过动画函数定义好动画后,需执行 start 方法,才会启动动画

start 方法可以传入一个动画结束/中断的回调函数

Animated.timing(value, {toValue: 1,duration: 1000,
}).start(({ finished }) => {if (finished) {console.log('动画成功完成');} else {console.log('动画被中断');}
});

动画类型

平移

可以通过设置不同的样式实现

  • marginLeft、marginRight、marginTop、marginBottom
  • translateX、translateY
  • 绝对定位时 left、right、top、bottom
import React, { useState } from "react";
import {Animated,Button,SafeAreaView,StyleSheet,Text,View,
} from "react-native";
const App = () => {// 使用 Animated.ValueXY 控制二维平移const positionAnim = useState(new Animated.ValueXY({ x: 0, y: 0 }))[0];// 使用单独的 Animated.Value 控制一维平移const translateX = useState(new Animated.Value(0))[0];const translateY = useState(new Animated.Value(0))[0];// 水平移动函数 - 使用 Animated.ValueXYconst moveHorizontal = () => {Animated.timing(positionAnim, {toValue: { x: positionAnim.x._value === 0 ? 150 : 0, y: 0 },duration: 1000,useNativeDriver: true,}).start();};// 垂直移动函数 - 使用 Animated.ValueXYconst moveVertical = () => {Animated.timing(positionAnim, {toValue: { x: 0, y: positionAnim.y._value === 0 ? 150 : 0 },duration: 1000,useNativeDriver: true,}).start();};// 对角线移动函数 - 使用 Animated.ValueXYconst moveDiagonal = () => {Animated.timing(positionAnim, {toValue: {x: positionAnim.x._value === 0 ? 150 : 0,y: positionAnim.y._value === 0 ? 150 : 0,},duration: 1000,useNativeDriver: true,}).start();};// 复合移动函数 - 使用单独的 Animated.Valueconst complexMove = () => {Animated.sequence([// 向右移动Animated.timing(translateX, {toValue: 150,duration: 1000,useNativeDriver: true,}),// 向下移动Animated.timing(translateY, {toValue: 150,duration: 1000,useNativeDriver: true,}),// 向左移动Animated.timing(translateX, {toValue: 0,duration: 1000,useNativeDriver: true,}),// 向上移动Animated.timing(translateY, {toValue: 0,duration: 1000,useNativeDriver: true,}),]).start();};// 重置所有动画const resetAnimation = () => {positionAnim.setValue({ x: 0, y: 0 });translateX.setValue(0);translateY.setValue(0);};return (<SafeAreaView style={styles.container}><View style={styles.controls}><Button title="水平移动" onPress={moveHorizontal} /><Button title="垂直移动" onPress={moveVertical} /><Button title="对角线移动" onPress={moveDiagonal} /><Button title="复合移动" onPress={complexMove} /><Button title="重置" onPress={resetAnimation} color="red" /></View>{/* 使用 Animated.ValueXY 的平移动画 */}<Animated.Viewstyle={[styles.box,{transform: [{ translateX: positionAnim.x },{ translateY: positionAnim.y },],},]}><Text style={styles.text}>ValueXY 平移</Text></Animated.View>{/* 使用单独 Animated.Value 的平移动画 */}<Animated.Viewstyle={[styles.box,{transform: [{ translateX }, { translateY }],backgroundColor: "green",marginTop: 20,},]}><Text style={styles.text}>独立值 平移</Text></Animated.View></SafeAreaView>);
};
const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center",alignItems: "center",},controls: {marginBottom: 20,width: "80%",flexDirection: "row",justifyContent: "space-around",flexWrap: "wrap",},box: {width: 120,height: 120,backgroundColor: "blue",justifyContent: "center",alignItems: "center",borderRadius: 10,},text: {color: "white",fontSize: 16,},
});
export default App;

旋转

需用 interpolate 实现角度值格式转换

import React, { useState } from "react";
import {Animated,Button,SafeAreaView,StyleSheet,Text,View,
} from "react-native";
const App = () => {// 2D旋转动画值 (单位是弧度)const rotateValue = useState(new Animated.Value(0))[0];// 开始旋转const startRotation = () => {Animated.loop(Animated.timing(rotateValue, {toValue: rotateValue._value + Math.PI * 2, // 每次增加360度duration: 3000, // 旋转一周的时间(毫秒)useNativeDriver: true, // 使用原生驱动以获得更好的性能})).start();};// 停止旋转const stopRotation = () => {rotateValue.stopAnimation();};// 重置旋转const resetRotation = () => {rotateValue.setValue(0);};// 将弧度值转换为角度值const rotateInterpolate = rotateValue.interpolate({inputRange: [0, Math.PI * 2],outputRange: ["0deg", "360deg"],});return (<SafeAreaView style={styles.container}><View style={styles.controls}><Button title="开始旋转" onPress={startRotation} /><Button title="停止旋转" onPress={stopRotation} /><Button title="重置" onPress={resetRotation} color="red" /></View>{/* 旋转视图 */}<Animated.Viewstyle={[styles.box,{transform: [{ rotate: rotateInterpolate }],},]}><Text style={styles.text}>2D旋转动画</Text></Animated.View></SafeAreaView>);
};
const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center",alignItems: "center",},controls: {marginBottom: 20,width: "80%",flexDirection: "row",justifyContent: "space-around",flexWrap: "wrap",},box: {width: 150,height: 150,backgroundColor: "blue",justifyContent: "center",alignItems: "center",borderRadius: 10,},text: {color: "white",fontSize: 18,},
});
export default App;

缩放

import React, { useState } from "react";
import {Animated,Button,SafeAreaView,StyleSheet,Text,View,
} from "react-native";
const App = () => {// 缩放动画值const scaleValue = useState(new Animated.Value(1))[0]; // 初始值为1(原始大小)// 放大动画const zoomIn = () => {Animated.timing(scaleValue, {toValue: 2, // 放大到2倍大小duration: 1000,useNativeDriver: true,}).start();};// 缩小动画const zoomOut = () => {Animated.timing(scaleValue, {toValue: 0.5, // 缩小到0.5倍大小duration: 1000,useNativeDriver: true,}).start();};// 恢复原始大小const resetScale = () => {Animated.timing(scaleValue, {toValue: 1, // 恢复到原始大小duration: 500,useNativeDriver: true,}).start();};// 脉冲动画(循环放大缩小)const pulse = () => {Animated.loop(Animated.sequence([Animated.timing(scaleValue, {toValue: 1.2,duration: 500,useNativeDriver: true,}),Animated.timing(scaleValue, {toValue: 0.8,duration: 500,useNativeDriver: true,}),Animated.timing(scaleValue, {toValue: 1,duration: 500,useNativeDriver: true,}),])).start();};// 停止所有动画const stopAnimation = () => {scaleValue.stopAnimation();};return (<SafeAreaView style={styles.container}><View style={styles.controls}><Button title="放大" onPress={zoomIn} /><Button title="缩小" onPress={zoomOut} /><Button title="恢复" onPress={resetScale} /><Button title="脉冲" onPress={pulse} /><Button title="停止" onPress={stopAnimation} color="red" /></View>{/* 缩放视图 */}<Animated.Viewstyle={[styles.box,{transform: [{ scale: scaleValue }],},]}><Text style={styles.text}>缩放动画</Text></Animated.View></SafeAreaView>);
};
const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center",alignItems: "center",},controls: {marginBottom: 20,width: "80%",flexDirection: "row",justifyContent: "space-around",flexWrap: "wrap",},box: {width: 150,height: 150,backgroundColor: "blue",justifyContent: "center",alignItems: "center",borderRadius: 10,},text: {color: "white",fontSize: 18,},
});
export default App;

渐变

渐变透明度 – 淡入/淡出

import React, { useState } from "react";
import {Animated,Button,SafeAreaView,StyleSheet,Text,View,
} from "react-native";
const App: React.FC = () => {// 透明度动画值const fadeAnim = useState(new Animated.Value(0))[0]; // 初始值为0(完全透明)// 淡入函数const fadeIn = () => {Animated.timing(fadeAnim, {toValue: 1, // 目标值为1(完全不透明)duration: 1500, // 动画持续时间(毫秒)useNativeDriver: true,}).start();};// 淡出函数const fadeOut = () => {Animated.timing(fadeAnim, {toValue: 0, // 目标值为0(完全透明)duration: 1500,useNativeDriver: true,}).start();};// 淡入淡出循环函数const fadeInOutLoop = () => {Animated.loop(Animated.sequence([Animated.timing(fadeAnim, {toValue: 1,duration: 1500,useNativeDriver: true,}),Animated.timing(fadeAnim, {toValue: 0,duration: 1500,useNativeDriver: true,}),])).start();};// 停止动画const stopAnimation = () => {fadeAnim.stopAnimation();};// 重置动画const resetAnimation = () => {stopAnimation();fadeAnim.setValue(0);};return (<SafeAreaView style={styles.container}><View style={styles.controls}><Button title="淡入" onPress={fadeIn} /><Button title="淡出" onPress={fadeOut} /><Button title="循环淡入淡出" onPress={fadeInOutLoop} /><Button title="停止" onPress={stopAnimation} /><Button title="重置" onPress={resetAnimation} color="red" /></View>{/* 淡入淡出视图 */}<Animated.Viewstyle={[styles.box,{opacity: fadeAnim, // 绑定透明度动画值},]}><Text style={styles.text}>淡入淡出示例</Text></Animated.View></SafeAreaView>);
};
const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center",alignItems: "center",},controls: {marginBottom: 20,width: "80%",flexDirection: "row",justifyContent: "space-around",flexWrap: "wrap",},box: {width: 200,height: 200,backgroundColor: "blue",justifyContent: "center",alignItems: "center",borderRadius: 10,marginTop: 20,},text: {color: "white",fontSize: 20,fontWeight: "bold",},
});
export default App;

渐变背景色

import React, { useState } from "react";
import {Animated,Button,SafeAreaView,StyleSheet,Text,View,
} from "react-native";
const App: React.FC = () => {// 渐变动画值const gradientAnim = useState(new Animated.Value(0))[0];// 开始渐变动画const startGradient = () => {Animated.loop(Animated.sequence([Animated.timing(gradientAnim, {toValue: 1,duration: 3000,useNativeDriver: true,}),Animated.timing(gradientAnim, {toValue: 0,duration: 3000,useNativeDriver: true,}),])).start();};// 停止渐变动画const stopGradient = () => {gradientAnim.stopAnimation();};// 重置渐变动画const resetGradient = () => {stopGradient();gradientAnim.setValue(0);};// 背景色插值 - 从蓝色渐变到绿色再到红色const backgroundColor = gradientAnim.interpolate({inputRange: [0, 0.5, 1],outputRange: ["rgba(0, 122, 255, 1)", // 蓝色"rgba(76, 217, 100, 1)", // 绿色"rgba(255, 59, 48, 1)", // 红色],});return (<SafeAreaView style={styles.container}><View style={styles.controls}><Button title="开始渐变" onPress={startGradient} /><Button title="停止渐变" onPress={stopGradient} /><Button title="重置" onPress={resetGradient} color="red" /></View>{/* 渐变背景色视图 */}<Animated.Viewstyle={[styles.box,{backgroundColor,},]}><Text style={styles.text}>渐变背景色示例</Text></Animated.View></SafeAreaView>);
};
const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center",alignItems: "center",},controls: {marginBottom: 20,width: "80%",flexDirection: "row",justifyContent: "space-around",flexWrap: "wrap",},box: {width: 250,height: 250,justifyContent: "center",alignItems: "center",borderRadius: 15,},text: {color: "white",fontSize: 22,fontWeight: "bold",textAlign: "center",},
});
export default App;

二维(矢量)动画 Animated.ValueXY

适合需要同时控制 x 和 y 坐标的场景

// 创建一个初始位置为 {x: 0, y: 0} 的 Animated.ValueXYconst position = useRef(new Animated.ValueXY()).current;const moveSquare = () => {// 同时对 x 和 y 进行动画Animated.timing(position, {toValue: { x: 200, y: 100 },duration: 1000,useNativeDriver: true,}).start();};
<Animated.Viewstyle={[{ transform: position.getTranslateTransform() } // 应用平移变换,返回 [{translateX: x}, {translateY: y}]]}/>

      <Animated.Viewstyle={[{ marginLeft: position.x, marginTop: position.y }]}/>

动画函数

动画类型适用场景示例
timing平滑过渡(如淡入淡出、平移)淡入淡出、缩放
spring弹性效果(如按钮点击反馈)弹跳、弹性拖拽
decay惯性滚动(如列表松手后继续滚动)滚动列表、滑动控件
parallel多属性同时动画(如边淡入边缩放)组合动画
sequence按顺序执行动画(如步骤引导)依次显示多个元素
stagger交错动画(如网格元素依次出现)瀑布流加载、菜单展开
loop循环动画(如加载指示器)旋转图标、呼吸效果

平滑动画 Animated.timing()

参数名类型描述默认值
toValuenumber动画的目标值必需
durationnumber动画持续时间(毫秒)500
easingfunction缓动函数,控制动画的速度曲线(如加速、减速、弹跳等)Easing.inOut(Easing.ease)
delaynumber动画延迟开始的时间(毫秒)0
isInteractionboolean标记动画是否为用户交互的结果(影响动画优先级)true
useNativeDriverboolean是否使用原生驱动(性能优化)。false

缓动函数 easing

可通过 https://easings.net/ 可视化查看动画效果

在这里插入图片描述

easing: Animated.Easing.ease, // 先加速后减速(默认)

取值有:

  • Animated.Easing.ease:先加速后减速(默认),比较平缓
  • Animated.Easing.linear:匀速运动 – 速度曲线为一次方函数(即直线)
  • Animated.Easing.quad:速度曲线为二次方函数(即抛物线)
  • Animated.Easing.cubic:速度曲线为三次方函数(比抛物线更陡)
  • Animated.Easing.sin:速度曲线为正弦曲线
  • Animated.Easing.exp:速度曲线为指数曲线
  • Animated.Easing.circle:速度曲线为环形(即圆)
  • Animated.Easing.bounce:弹跳效果(不会超过最终位置,类似弹力球落地撞回,回弹高度不断衰减,直到停止)
  • Animated.Easing.elastic(amplitude):弹性效果
    • amplitude 为可选参数,表示振幅,默认值为 1
  • Animated.Easing.in(EasingFunc):加速,将参数(缓动函数)的速度曲线应用于动画的开始阶段
  • Animated.Easing.out(EasingFunc):减速,将参数(缓动函数)的速度曲线应用于动画的结束阶段
  • Animated.Easing.inOut(type):先加速后减速,将参数(缓动函数)的速度曲线应用于动画的开始和结束阶段
  • Animated.Easing.back(overshoot):后拉特效
    • overshoot 为可选参数,表示 “超出” 的程度,默认值为 1.70158,值越大,超出的距离越远,回弹效果越明显,推荐值为 3
  • Animated.Easing.bezier(x1, y1, x2, y2) 创建自定义的贝塞尔曲线缓动函数
    • x1, y1:第一个控制点的坐标

    • x2, y2:第二个控制点的坐标

      可通过下方链接,可视化调节曲线,获取到目标参数值
      https://cubic-bezier.com/

在这里插入图片描述

弹性动画 Animated.spring()

模拟真实世界中弹簧的物理行为,包括弹性、阻尼和质量

使用场景

  • 交互反馈:按钮点击、拖拽释放后的回弹效果
  • 导航转换:页面切换时的弹性过渡
  • 加载指示器:使用弹簧动画创建弹性加载效果
  • 微交互:如点赞、收藏等状态变化的反馈动画
Animated.spring(scaleAnim, {toValue: 1,friction: 2, // 摩擦力(阻尼),值越小弹性越大tension: 30, // 张力(弹性),值越大弹簧越硬useNativeDriver: false,}).start(),

共三种配置方式,只能选一种!

配置方式一:bounciness + speed

  • bounciness(弹性): 越大弹的幅度越大,默认值8
  • speed(速度): 越大弹得越快,默认值12

配置方式二:tension + friction

  • tension(张力):控制速度,越大速度越快,默认值40
  • friction(摩擦):控制能量耗散的速度,决定弹簧停止振动的快慢,越小弹得越久,默认值7

配置方式三:tension + friction

  • stiffness(刚度): 弹簧刚度系数,越大越弹,默认为100
  • damping(阻尼): 弹簧运动因摩擦力而受到阻尼,越小越弹,默认值10
  • mass(质量): 附着在弹末端的物体的质量,越大惯性越大,动画越难停下,越小惯性越小,动画很快停下,默认值1

其他参数

  • velocity(速度): 附着在弹上物体的初始速度,默认值0
  • overshootClamping(过冲): 弹是否应夹紧而不应弹跳,默认为false
  • restDisplacementThreshold(恢复位移阈值): 从静止状态开始的位移阈值,低于该阈值,弹簧应被视为静止状态,默认为0.001
  • restspeedthreshold(弹簧静止速度),单位为像素/秒,默认为0.001
  • delay(延迟):延迟后启动动画,默认为0

衰减动画 Animated.decay()

用于滚动或拖拽结束后的惯性效果。

const scrollAnim = new Animated.Value(0);Animated.decay(scrollAnim, {velocity: 1,      // 初始速度(必选)deceleration: 0.997, // 减速系数useNativeDriver: false,
}).start();

deceleration 的值越小,则衰减越快,动画越快结束。

组合动画

方法执行方式中断行为适用场景
parallel并行执行默认全部中断多属性同步变化、多元素协同动画
sequence按顺序执行中断当前,后续不执行分步动画、依赖关系动画
stagger错开时间并行执行默认全部中断级联效果、列表项依次出现
loop无限循环执行手动停止加载动画、背景循环效果

同时执行 Animated.parallel

Animated.parallel([Animated.timing(opacity, { toValue: 1 }),    // 淡入Animated.spring(scale, { toValue: 1.5 }),   // 缩放Animated.timing(rotation, { toValue: 1 }),  // 旋转
]).start();

顺序执行 Animated.sequence

Animated.sequence([Animated.timing(opacity, { toValue: 1 }),    // 第一步:淡入Animated.timing(position, { toValue: { x: 100, y: 0 } }),  // 第二步:平移Animated.spring(scale, { toValue: 0.8 }),   // 第三步:缩放回弹
]).start();

错开执行 Animated.stagger

Animated.stagger(100, [  // 每个动画间隔100msAnimated.timing(items[0].opacity, { toValue: 1 }),Animated.timing(items[1].opacity, { toValue: 1 }),Animated.timing(items[2].opacity, { toValue: 1 }),
]).start();

循环执行 Animated.loop

Animated.loop(Animated.sequence([Animated.timing(rotation, { toValue: 1, duration: 2000 }),Animated.timing(rotation, { toValue: 0, duration: 2000 }),])
).start();

动画控制

延迟执行 Animated.delay

Animated.delay(1000); // 创建一个1000ms(1秒)的延迟

Animated.sequence([Animated.delay(500),             // 先等待500msAnimated.timing(value1, { ... }), // 然后执行第一个动画Animated.delay(300),             // 再等待300msAnimated.timing(value2, { ... }), // 最后执行第二个动画
]).start();

布局动画 LayoutAnimation

适用于自动给布局变化添加动画,特别丝滑好用

Android 中需手动开启布局动画

import { LayoutAnimation, UIManager } from 'react-native';// 启用布局动画(仅 Android 需要)
if (Platform.OS === 'android') {UIManager.setLayoutAnimationEnabledExperimental(true);
}

预设动画效果

  1. LayoutAnimation.Presets.linear

    • 匀速变化
    • 持续时间:500ms

  2. LayoutAnimation.Presets.easeInEaseOut

    • 先慢后快再慢
    • 持续时间:300ms

  3. LayoutAnimation.Presets.spring

    • 带有弹性效果
    • 持续时间:700ms
    • 弹性参数:阻尼系数 0.5,初始速度 0.8

自定义动画配置

LayoutAnimation.configureNext(LayoutAnimation.create(500,                         // 动画持续时间(毫秒)LayoutAnimation.Types.easeInEaseOut, // 动画类型LayoutAnimation.Properties.opacity  // 要动画的属性)
);

支持的动画类型:spring、linear、easeInEaseOut、easeIn、easeOut
支持的动画属性:opacity、scaleXY、translate、width、height

实战范例:显隐组件

import React, { useState } from 'react';
import {Button,LayoutAnimation,StyleSheet,UIManager,View,Platform,
} from 'react-native';// 启用布局动画(仅 Android 需要)
if (Platform.OS === 'android') {UIManager.setLayoutAnimationEnabledExperimental(true);
}const LayoutAnimationExample = () => {const [showBox, setShowBox] = useState(true);const toggleBox = () => {// 配置下一次布局更新的动画LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);// 修改状态,触发布局更新setShowBox(!showBox);};return (<View style={styles.container}><Button title="切换显示/隐藏" onPress={toggleBox} />{showBox && (<View style={styles.box} />)}</View>);
};const styles = StyleSheet.create({container: {flex: 1,alignItems: 'center',justifyContent: 'center',padding: 20,},box: {width: 200,height: 200,backgroundColor: 'blue',borderRadius: 10,marginTop: 20,},
});export default LayoutAnimationExample;

实战范例

  • 同步跟随滚动
    https://blog.csdn.net/weixin_41192489/article/details/148795183

  • 弹跳动画菜单导航
    https://blog.csdn.net/weixin_41192489/article/details/148796837

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/web/86141.shtml
繁体地址,请注明出处:http://hk.pswp.cn/web/86141.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何轻松地将照片从 iPhone 传输到计算机

如果您的照片占据了 iPhone 上最多的存储空间&#xff0c;为什么不将照片从 iPhone 传输到电脑呢&#xff1f;您可能想要这样做&#xff0c;但不知道如何开始&#xff1f;如果是这样&#xff0c;那么本指南就是您所需要的。我们分享了 6 种方法以及步骤详细信息。您可以按照一种…

操作系统之内存管理(王道)

本篇博客依据王道、与我的笔记而写&#xff0c;讲解了内存的基础知识、内存管理的概念、进程的映像、连续分配管理方式、动态分区分配算法、基本分页存储管理、基本地址变换机构、TLB快表、两级页表、基本分段存储管理方式、段页式存储管理方式、虚拟内存、请求分页管理方式、页…

C++11 std::thread 多线程编程详解

C++11 标准首次将多线程支持引入语言标准库,其中最核心的部分就是 <thread> 头文件中的 std::thread 类。 🧱 一、基本概念 什么是线程? 线程是操作系统调度 CPU 时间的基本单位。一个进程中可以有多个线程,它们共享进程的资源(如内存、堆栈),但拥有各自独立的…

设置vscode使用eslint

在 Visual Studio Code (VSCode) 中设置 ESLint 是一个很好的方式来确保代码质量和一致性。以下是详细的步骤&#xff1a; 1. 安装 ESLint 扩展 打开 VSCode。点击左侧的扩展图标&#xff08;四边形图标&#xff09;。在搜索框中输入 ESLint。找到由 dbaeumer 提供的 ESLint …

.NET 生态中主流的前后端生产级框架

文章目录 **1. 后端框架&#xff08;Backend Frameworks&#xff09;****(1) ASP.NET Core**&#xff08;微软官方&#xff0c;主流选择&#xff09;**(2) ABP Framework**&#xff08;企业级应用开发框架&#xff09; **2. 前端框架&#xff08;Frontend Frameworks&#xff0…

Spring Cloud Alibaba整合Sentinel指南

目录 一、Sentinel核心功能概述 1. 控制台安装 2. 项目依赖配置 三、详细整合步骤 1. 基础配置 2. 资源定义与保护 3. 与OpenFeign整合 四、常见问题解决方案 五、最佳实践案例 1. 流量控制场景 2. 熔断降级场景 3. 热点参数限流 六、高级功能 Spring Cloud Aliba…

Win10+PHPStudy 8.1完美运行CRMEB开源商城(附性能优化配置)

环境配置 下载phpstudy https://www.xp.cn/ 安装完成之后打开&#xff0c;在软件管理中安装 nginx mysql 5.7 php 7.4 创建站点 填写域名&#xff0c;根目录选择到public文件夹下 创建完成之后&#xff0c;点击右侧管理&#xff0c;选择伪静态 location / { if (!-e $request…

康谋方案 | ARXML 规则下 ECU 总线通讯与 ADTF 测试方案

目录 一、引言 二、汽车电子控制系统 三、ECU开发流程中总线通讯&#xff1a;ARXML 规则下的标准化协作 四、ADTF&#xff1a;汽车数据与时间触发框架&#xff08;Automotive Data and Time-Triggered Framework&#xff09; 五、应用案例 六、结语 一、引言 随着汽车新…

常见JavaScript 代理模式应用场景解析

常见JavaScript 代理模式应用场景解析 在 JavaScript 开发中&#xff0c;代理模式&#xff08;Proxy Pattern&#xff09; 是一种强大的设计模式&#xff0c;它允许我们通过创建一个“代理”来控制对目标对象的访问。通过代理&#xff0c;我们可以拦截并增强对象的行为&#x…

暴雨信创电脑代理商成功中标长沙市中医康复医院

6月25日&#xff0c;国内科技产业领军企业暴雨信息传来喜讯&#xff0c;其信创电脑成功中标长沙市中医康复医院信息化设备采购项目。此次中标&#xff0c;不仅彰显了暴雨信息在信创领域的技术实力和产品优势&#xff0c;也为长沙市中医康复医院的信息化建设注入了新的活力。 长…

ZYNQ PL高速采集AD7606数据与QT动态显示全解析

从硬件设计到软件优化,打造工业级数据采集系统 在工业自动化、医疗仪器等领域,高速多通道数据采集系统至关重要。本文手把手教你基于Xilinx ZYNQ平台,实现8通道200kSPS高速采集**,并通过QT实现60fps动态波形显示。突破性采用五级流水采集架构和GPU加速渲染,解决传统方案的…

还是工作日志

今天感觉效率有点低&#xff0c;可能是太热了 【100】 开始不懂了 https://www.bilibili.com/video/BV1rL411E7uz?t1193.7&p100 什么新增&#xff0c;什么新增和变化 【101】退单 开头就说不适合做事务型 https://www.bilibili.com/video/BV1rL411E7uz?t26.6&…

青少年编程与数学 01-012 通用应用软件简介 10 云存储软件

青少年编程与数学 01-012 通用应用软件简介 10 云存储软件 一、什么是云存储软件&#xff08;一&#xff09;云存储软件的基本定义&#xff08;二&#xff09;云存储软件的工作原理&#xff08;三&#xff09;云存储软件的类型 二、云存储软件的重要意义&#xff08;一&#xf…

华为云Flexus+DeepSeek征文 | 掌握高效开发:利用华为云ModelArts Studio在VS Code中配置Cline AI编程助手

华为云FlexusDeepSeek征文 | 掌握高效开发&#xff1a;利用华为云ModelArts Studio在VS Code中配置Cline AI编程助手 引言一、ModelArts Studio平台介绍华为云ModelArts Studio简介ModelArts Studio主要特点 二、Cline介绍Cline介绍Cline主要特点 三、开通DeepSeek-R1-0528商用…

Python核心可视化库:Matplotlib与Seaborn深度解析

文章目录 前言一、Matplotlib&#xff1a;科学可视化的基石1.1 核心架构层级后端层&#xff08;Backend Layer&#xff09;艺术家层&#xff08;Artist Layer&#xff09;脚本层&#xff08;Scripting Layer&#xff09; 1.2 核心模块详解matplotlib.figure 模块matplotlib.axe…

EJB知识

EJB&#xff08;Enterprise JavaBeans&#xff09;是 Java EE&#xff08;现称 Jakarta EE&#xff09;平台的核心技术之一&#xff0c;用于开发分布式、可扩展、事务性的企业级应用。以下从基础到高级全面解析 EJB&#xff1a; 一、EJB 基础概念 1. 定义与角色 EJB 是服务器…

【项目管理】项目管理资料文档模板(ZIP,PPT,WORD)

项目交付文档 01项目详细调研计划编写规范V1.0.doc 03项目详细调研报告编写规范V1.0.doc 07软件需求规格说明书评审规范V1.0.doc 10.软件需求规格说明.doc 产品检查单,xls 工程评审.zip 软件标准过程集.zip 系统测试管理规程.docx 四)项目管理计划.doc 项目管理系统实施项目管理…

CentOS 6 Linux 系统添加永久静态路由的方法详解!

全文目录&#xff1a; 开篇语 **【详解】**1. **静态路由的概念与应用场景**1.1 **静态路由简介**1.2 **静态路由的应用场景** 2. **临时添加静态路由**2.1 **使用 route 命令临时添加静态路由**示例&#xff1a;添加一个临时路由 2.2 **查看当前路由表**2.3 **临时路由的局限性…

(mysql、oracle、pgsql、mongodb、redis、es)主流数据库的核心差异

以下是主流数据库的核心差异及适用场景的全面对比&#xff0c;结合技术特性和实际应用需求整理&#xff1a; &#x1f4ca; 一、数据库分类与核心差异 1. 关系型数据库&#xff08;RDBMS&#xff09; 数据库核心特点适用场景MySQL开源、读写性能均衡&#xff0c;易用性高&…

第8章:智能菜谱生成器——语言模型如何解析烹饪秘方

第8章:智能菜谱生成器——语言模型如何解析烹饪秘方 从语义理解到操作执行的完整技术解密 工业案例背景: 法国里昂的Bocuse d’Or国际烹饪大赛选手手册中记载这样一道经典指令:“将酱汁熬煮至Napp状态(即勺子划过痕迹缓慢回填)”。当传统NLP系统将其简单译为"煮浓&q…