iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >Springboot事件和bean生命周期执行机制是什么
  • 584
分享到

Springboot事件和bean生命周期执行机制是什么

2023-07-05 17:07:10 584人浏览 薄情痞子
摘要

今天小编给大家分享一下SpringBoot事件和bean生命周期执行机制是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

今天小编给大家分享一下SpringBoot事件和bean生命周期执行机制是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

@PostConstruct执行机制

进入springApplication#run(java.lang.String…)

public ConfigurableApplicationContext run(String... args) {StopWatch stopWatch = new StopWatch();stopWatch.start();ConfigurableApplicationContext context = null;configureHeadlessProperty();SpringApplicationRunListeners listeners = getRunListeners(args);listeners.starting();try {ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);ConfigurableEnvironment environment = prepareEnvironment(listeners, applicationArguments);configureIgnoreBeanInfo(environment);Banner printedBanner = printBanner(environment);context = createApplicationContext();prepareContext(context, environment, listeners, applicationArguments, printedBanner);//这里进入就会执行经典的refresh方法进行容器创建工作refreshContext(context);afterRefresh(context, applicationArguments);stopWatch.stop();if (this.logStartupInfo) {new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), stopWatch);}listeners.started(context);callRunners(context, applicationArguments);}catch (Throwable ex) {handleRunFailure(context, ex, listeners);throw new IllegalStateException(ex);}try {listeners.running(context);}catch (Throwable ex) {handleRunFailure(context, ex, null);throw new IllegalStateException(ex);}return context;}

进入AbstractApplicationContext#refresh

public void refresh() throws BeansException, IllegalStateException {synchronized (this.startupShutdownMonitor) {// Prepare this context for refreshing.prepareRefresh();// Tell the subclass to refresh the internal bean factory.ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();// Prepare the bean factory for use in this context.prepareBeanFactory(beanFactory);try {// Allows post-processing of the bean factory in context subclasses.postProcessBeanFactory(beanFactory);// Invoke factory processors reGIStered as beans in the context.invokeBeanFactoryPostProcessors(beanFactory);// Register bean processors that intercept bean creation.registerBeanPostProcessors(beanFactory);// Initialize message source for this context.initMessageSource();// Initialize event multicaster for this context.initApplicationEventMulticaster();// Initialize other special beans in specific context subclasses.onRefresh();// Check for listener beans and register them.registerListeners();// 在这里将非懒加载的bean进行创建finishBeanFactoryInitialization(beanFactory);// Last step: publish corresponding event.finishRefresh();}catch (BeansException ex) {if (logger.isWarnEnabled()) {logger.warn("Exception encountered during context initialization - " +"cancelling refresh attempt: " + ex);}// Destroy already created singletons to avoid dangling resources.destroyBeans();// Reset 'active' flag.cancelRefresh(ex);// Propagate exception to caller.throw ex;}finally {// Reset common introspection caches in Spring's core, since we// might not ever need metadata for singleton beans anymore...resetCommonCaches();}}}

进入AbstractApplicationContext#finishBeanFactoryInitialization

AbstractApplicationContext#finishBeanFactoryInitialization

protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) {// Initialize conversion service for this context.if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME) &&beanFactory.isTypeMatch(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class)) {beanFactory.setConversionService(beanFactory.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class));}// Register a default embedded value resolver if no BeanFactoryPostProcessor// (such as a PropertySourcesPlaceholderConfigurer bean) registered any before:// at this point, primarily for resolution in annotation attribute values.if (!beanFactory.hasEmbeddedValueResolver()) {beanFactory.addEmbeddedValueResolver(strVal -> getEnvironment().resolvePlaceholders(strVal));}// Initialize LoadTimeWeaverAware beans early to allow for registering their transfORMers early.String[] weaverAwareNames = beanFactory.getBeanNamesForType(LoadTimeWeaverAware.class, false, false);for (String weaverAwareName : weaverAwareNames) {getBean(weaverAwareName);}// Stop using the temporary ClassLoader for type matching.beanFactory.setTempClassLoader(null);// Allow for caching all bean definition metadata, not expecting further changes.beanFactory.freezeConfiguration();// 将非单例的对象进行真正的创建beanFactory.preInstantiateSingletons();}

beanFactory.preInstantiateSingletons()中就是循环的创建将非单例的对象,此方法会一直调用到AbstractAutowireCapableBeanFactory#doCreateBean

AbstractAutowireCapableBeanFactory#doCreateBean

protected Object doCreateBean(String beanName, RootBeanDefinition mbd, @Nullable Object[] args)throws BeanCreationException {// Instantiate the bean.BeanWrapper instanceWrapper = null;if (mbd.isSingleton()) {instanceWrapper = this.factoryBeanInstanceCache.remove(beanName);}//真正的创建对象if (instanceWrapper == null) {instanceWrapper = createBeanInstance(beanName, mbd, args);}Object bean = instanceWrapper.getWrappedInstance();Class<?> beanType = instanceWrapper.getWrappedClass();if (beanType != NullBean.class) {mbd.resolvedTargetType = beanType;}// Allow post-processors to modify the merged bean definition.synchronized (mbd.postProcessingLock) {if (!mbd.postProcessed) {try {applyMergedBeanDefinitionPostProcessors(mbd, beanType, beanName);}catch (Throwable ex) {throw new BeanCreationException(mbd.getResourceDescription(), beanName,"Post-processing of merged bean definition failed", ex);}mbd.postProcessed = true;}}// Eagerly cache singletons to be able to resolve circular references// even when triggered by lifecycle interfaces like BeanFactoryAware.boolean earlySingletonExposure = (mbd.isSingleton() && this.allowCircularReferences &&isSingletonCurrentlyInCreation(beanName));if (earlySingletonExposure) {if (logger.isTraceEnabled()) {logger.trace("Eagerly caching bean '" + beanName +"' to allow for resolving potential circular references");}addSingletonFactory(beanName, () -> getEarlyBeanReference(beanName, mbd, bean));}// Initialize the bean instance.Object exposedObject = bean;try {populateBean(beanName, mbd, instanceWrapper);//生命周期方法的执行 @PostConstruct就是在此执行的exposedObject = initializeBean(beanName, exposedObject, mbd);}catch (Throwable ex) {if (ex instanceof BeanCreationException && beanName.equals(((BeanCreationException) ex).getBeanName())) {throw (BeanCreationException) ex;}else {throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Initialization of bean failed", ex);}}if (earlySingletonExposure) {Object earlySingletonReference = getSingleton(beanName, false);if (earlySingletonReference != null) {if (exposedObject == bean) {exposedObject = earlySingletonReference;}else if (!this.allowRawInjectionDespiteWrapping && hasDependentBean(beanName)) {String[] dependentBeans = getDependentBeans(beanName);Set<String> actualDependentBeans = new LinkedHashSet<>(dependentBeans.length);for (String dependentBean : dependentBeans) {if (!removeSingletonIfCreatedForTypeCheckOnly(dependentBean)) {actualDependentBeans.add(dependentBean);}}if (!actualDependentBeans.isEmpty()) {throw new BeanCurrentlyInCreationException(beanName,"Bean with name '" + beanName + "' has been injected into other beans [" +StringUtils.collectionToCommaDelimitedString(actualDependentBeans) +"] in its raw version as part of a circular reference, but has eventually been " +"wrapped. This means that said other beans do not use the final version of the " +"bean. This is often the result of over-eager type matching - consider using " +"'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.");}}}}// Register bean as disposable.try {registerDisposableBeanIfNecessary(beanName, bean, mbd);}catch (BeanDefinitionValidationException ex) {throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Invalid destruction signature", ex);}return exposedObject;}

AbstractAutowireCapableBeanFactory#initializeBean其中的执行之一就是@PostConstruct

AbstractAutowireCapableBeanFactory#initializeBean

protected Object initializeBean(String beanName, Object bean, @Nullable RootBeanDefinition mbd) {if (System.getSecurityManager() != null) {AccessController.doPrivileged((PrivilegedAction<Object>) () -> {invokeAwareMethods(beanName, bean);return null;}, getAccessControlContext());}else {invokeAwareMethods(beanName, bean);}Object wrappedBean = bean;if (mbd == null || !mbd.isSynthetic()) {//循环执行PostProcessors后置处理器的postProcessBeforeInitialization方法,@PostConstruct就是在这里执行的wrappedBean = applyBeanPostProcessorsBeforeInitialization(wrappedBean, beanName);}try {invokeInitMethods(beanName, wrappedBean, mbd);}catch (Throwable ex) {throw new BeanCreationException((mbd != null ? mbd.getResourceDescription() : null),beanName, "Invocation of init method failed", ex);}if (mbd == null || !mbd.isSynthetic()) {wrappedBean = applyBeanPostProcessorsAfterInitialization(wrappedBean, beanName);}return wrappedBean;}

AbstractAutowireCapableBeanFactory#applyBeanPostProcessorsBeforeInitialization

public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)throws BeansException {Object result = existingBean;for (BeanPostProcessor processor : getBeanPostProcessors()) {//当循环到processor=CommonAnnotationBeanPostProcessor时,点击进入分析Object current = processor.postProcessBeforeInitialization(result, beanName);if (current == null) {return result;}result = current;}return result;}

CommonAnnotationBeanPostProcessor继承了InitDestroyAnnotationBeanPostProcessorpostProcessBeforeInitialization(Object bean, String beanName)方法在父类中

InitDestroyAnnotationBeanPostProcessor#postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass());try {metadata.invokeInitMethods(bean, beanName);}catch (InvocationTargetException ex) {throw new BeanCreationException(beanName, "Invocation of init method failed", ex.getTargetException());}catch (Throwable ex) {throw new BeanCreationException(beanName, "Failed to invoke init method", ex);}return bean;}

InitDestroyAnnotationBeanPostProcessor.LifecycleMetadata#invokeInitMethods

public void invokeInitMethods(Object target, String beanName) throws Throwable {  Collection<LifecycleElement> checkedInitMethods = this.checkedInitMethods;  Collection<LifecycleElement> initMethodsToIterate =      (checkedInitMethods != null ? checkedInitMethods : this.initMethods);  if (!initMethodsToIterate.isEmpty()) {    for (LifecycleElement element : initMethodsToIterate) {      if (logger.isTraceEnabled()) {        logger.trace("Invoking init method on bean '" + beanName + "': " + element.getMethod());      }      //在这里反射执行带有@PostConstruct注解的方法      element.invoke(target);    }  }}

ContextRefreshedEvent事件机制

进入SpringApplication#run(java.lang.String&hellip;)

public ConfigurableApplicationContext run(String... args) {StopWatch stopWatch = new StopWatch();stopWatch.start();ConfigurableApplicationContext context = null;configureHeadlessProperty();SpringApplicationRunListeners listeners = getRunListeners(args);listeners.starting();try {ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);ConfigurableEnvironment environment = prepareEnvironment(listeners, applicationArguments);configureIgnoreBeanInfo(environment);Banner printedBanner = printBanner(environment);context = createApplicationContext();prepareContext(context, environment, listeners, applicationArguments, printedBanner);//这里进入就会执行经典的refresh方法进行容器创建工作refreshContext(context);afterRefresh(context, applicationArguments);stopWatch.stop();if (this.logStartupInfo) {new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), stopWatch);}listeners.started(context);callRunners(context, applicationArguments);}catch (Throwable ex) {handleRunFailure(context, ex, listeners);throw new IllegalStateException(ex);}try {listeners.running(context);}catch (Throwable ex) {handleRunFailure(context, ex, null);throw new IllegalStateException(ex);}return context;}

进入AbstractApplicationContext#refresh

public void refresh() throws BeansException, IllegalStateException {synchronized (this.startupShutdownMonitor) {// Prepare this context for refreshing.prepareRefresh();// Tell the subclass to refresh the internal bean factory.ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();// Prepare the bean factory for use in this context.prepareBeanFactory(beanFactory);try {// Allows post-processing of the bean factory in context subclasses.postProcessBeanFactory(beanFactory);// Invoke factory processors registered as beans in the context.invokeBeanFactoryPostProcessors(beanFactory);// Register bean processors that intercept bean creation.registerBeanPostProcessors(beanFactory);// Initialize message source for this context.initMessageSource();// Initialize event multicaster for this context.initApplicationEventMulticaster();// Initialize other special beans in specific context subclasses.onRefresh();// Check for listener beans and register them.registerListeners();// Instantiate all remaining (non-lazy-init) singletons.finishBeanFactoryInitialization(beanFactory);//在这个方法进行发布ContextRefreshedEvent事件finishRefresh();}catch (BeansException ex) {if (logger.isWarnEnabled()) {logger.warn("Exception encountered during context initialization - " +"cancelling refresh attempt: " + ex);}// Destroy already created singletons to avoid dangling resources.destroyBeans();// Reset 'active' flag.cancelRefresh(ex);// Propagate exception to caller.throw ex;}finally {// Reset common introspection caches in Spring's core, since we// might not ever need metadata for singleton beans anymore...resetCommonCaches();}}}

AbstractApplicationContext#finishRefresh

protected void finishRefresh() {  // Clear context-level resource caches (such as ASM metadata from scanning).  clearResourceCaches();  // Initialize lifecycle processor for this context.  initLifecycleProcessor();  // Propagate refresh to lifecycle processor first.  getLifecycleProcessor().onRefresh();  // 这里进行真正的ContextRefreshedEvent事件发布  publishEvent(new ContextRefreshedEvent(this));  // Participate in LiveBeansView MBean, if active.  LiveBeansView.registerApplicationContext(this);}

AbstractApplicationContext#publishEvent

protected void publishEvent(Object event, @Nullable ResolvableType eventType) {  Assert.notNull(event, "Event must not be null");  // Decorate event as an ApplicationEvent if necessary  ApplicationEvent applicationEvent;  if (event instanceof ApplicationEvent) {    applicationEvent = (ApplicationEvent) event;  }  else {    applicationEvent = new PayloadApplicationEvent<>(this, event);    if (eventType == null) {      eventType = ((PayloadApplicationEvent<?>) applicationEvent).getResolvableType();    }  }  // Multicast right now if possible - or lazily once the multicaster is initialized  if (this.earlyApplicationEvents != null) {    this.earlyApplicationEvents.add(applicationEvent);  }  else {    //通过spring的applicationContext进行ContextRefreshedEvent事件发布    getApplicationEventMulticaster().multicastEvent(applicationEvent, eventType);  }  // Publish event via parent context as well...  if (this.parent != null) {    if (this.parent instanceof AbstractApplicationContext) {      //如果执行到这里说明是有的bean依赖了微服务Feign的接口,springboot就会生成Feign的接口的bean,      //每个feign会有自己spring上下文容器是为了集成ribbon的配置,这里的parent就是父容器也就是springboot本身的上下文容器      ((AbstractApplicationContext) this.parent).publishEvent(event, eventType);    }    else {      this.parent.publishEvent(event);    }  }}

ApplicationStartedEvent事件机制

依旧进入SpringApplication#run(java.lang.String&hellip;)

public ConfigurableApplicationContext run(String... args) {StopWatch stopWatch = new StopWatch();stopWatch.start();ConfigurableApplicationContext context = null;configureHeadlessProperty();SpringApplicationRunListeners listeners = getRunListeners(args);listeners.starting();try {ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);ConfigurableEnvironment environment = prepareEnvironment(listeners, applicationArguments);configureIgnoreBeanInfo(environment);Banner printedBanner = printBanner(environment);context = createApplicationContext();prepareContext(context, environment, listeners, applicationArguments, printedBanner);refreshContext(context);afterRefresh(context, applicationArguments);stopWatch.stop();if (this.logStartupInfo) {new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), stopWatch);}    //在这里就进行ApplicationStartedEvent事件的发布listeners.started(context);callRunners(context, applicationArguments);}catch (Throwable ex) {handleRunFailure(context, ex, listeners);throw new IllegalStateException(ex);}try {listeners.running(context);}catch (Throwable ex) {handleRunFailure(context, ex, null);throw new IllegalStateException(ex);}return context;}

EventPublishingRunListener#started

public void started(ConfigurableApplicationContext context) {  //进行ApplicationStartedEvent事件的发布  context.publishEvent(new ApplicationStartedEvent(this.application, this.args, context));  AvailabilityChangeEvent.publish(context, LivenessState.CORRECT);}

以上就是“Springboot事件和bean生命周期执行机制是什么”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注编程网精选频道。

--结束END--

本文标题: Springboot事件和bean生命周期执行机制是什么

本文链接: https://www.lsjlt.com/news/353755.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Springboot事件和bean生命周期执行机制是什么
    今天小编给大家分享一下Springboot事件和bean生命周期执行机制是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。...
    99+
    2023-07-05
  • SpringBoot源码之Bean的生命周期是什么
    本文小编为大家详细介绍“SpringBoot源码之Bean的生命周期是什么”,内容详细,步骤清晰,细节处理妥当,希望这篇“SpringBoot源码之Bean的生命周期是什么”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知...
    99+
    2023-07-06
  • Spring bean的生命周期是什么
    Spring bean的生命周期包括以下阶段:1. 实例化(Instantiation):在容器启动时,Spring根据配置信息或注...
    99+
    2023-08-24
    Spring bean
  • Spring Bean的生命周期是什么
    这篇“Spring Bean的生命周期是什么”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Spring ...
    99+
    2023-07-05
  • spring中bean的生命周期是什么
    在Spring中,Bean的生命周期包括以下几个阶段:1. 实例化:当Spring容器接收到请求时,根据配置文件或注解等方式,在内存...
    99+
    2023-09-27
    spring bean
  • Angular生命周期执行的顺序是什么
    这篇文章主要介绍“Angular生命周期执行的顺序是什么”,在日常操作中,相信很多人在Angular生命周期执行的顺序是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Angular生命周期执行的顺序是什么...
    99+
    2023-07-05
  • Spring的Bean初始化过程和生命周期是什么
    本篇内容介绍了“Spring的Bean初始化过程和生命周期是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!一、Spring创建bean的...
    99+
    2023-07-05
  • Spring中Bean的作用域与生命周期是什么
    这篇文章主要讲解了“Spring中Bean的作用域与生命周期是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Spring中Bean的作用域与生命周期是什么”吧!一、Bean的作用域通过S...
    99+
    2023-06-22
  • Blazor组件的生命周期是什么
    今天小编给大家分享一下Blazor组件的生命周期是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。执行周期 SetPara...
    99+
    2023-06-29
  • React组件的生命周期是什么
    这篇文章主要讲解了“React组件的生命周期是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“React组件的生命周期是什么”吧!React生命周期1、初始化阶段componentDidM...
    99+
    2023-07-05
  • angular组件通讯和组件生命周期是什么
    本文小编为大家详细介绍“angular组件通讯和组件生命周期是什么”,内容详细,步骤清晰,细节处理妥当,希望这篇“angular组件通讯和组件生命周期是什么”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深...
    99+
    2024-04-02
  • vue组件生命周期指的是什么
    这篇文章将为大家详细讲解有关vue组件生命周期指的是什么,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。 在vue组件中,生命周期指的是从组件创...
    99+
    2024-04-02
  • javabean的生命周期和特点是什么
    JavaBean是一种符合JavaBeans规范的特殊Java类,它具有一定的生命周期和特点。1. 生命周期:- 创建阶段:Java...
    99+
    2023-08-26
    javabean
  • Spring IOC容器Bean的作用域及生命周期是什么
    本篇内容介绍了“Spring IOC容器Bean的作用域及生命周期是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!bean作用域bean...
    99+
    2023-06-30
  • Vue生命周期中的组件化是什么
    这篇文章主要介绍了Vue生命周期中的组件化是什么,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。引出生命周期此时调用change,定时器回调修改opacity,数据修改,模板重...
    99+
    2023-06-29
  • vue2与vue3中的生命周期执行顺序有什么区别
    vue2与vue3中生命周期执行顺序区别生命周期比较vue2中执行顺序 beforeCreate=>created=>beforeMount =>mounted=>beforeUpdate =>upd...
    99+
    2023-05-16
    Vue3 vue2
  • FESCAR管理分布式事务的生命周期是什么
    这篇文章主要介绍“FESCAR管理分布式事务的生命周期是什么”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“FESCAR管理分布式事务的生命周期是什么”文章能帮助大家解决问题。什么是FESCAR?一种...
    99+
    2023-06-29
  • Vue组件生命周期的三个阶段是什么
    这篇文章主要介绍“Vue组件生命周期的三个阶段是什么”,在日常操作中,相信很多人在Vue组件生命周期的三个阶段是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Vue组件生命周期的三个阶段是什么”的疑惑有所...
    99+
    2023-07-04
  • Vue中的生命周期和数据共享是什么
    这篇文章主要介绍了Vue中的生命周期和数据共享是什么的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Vue中的生命周期和数据共享是什么文章都会有所收获,下面我们一起来看看吧。一、组件的生命周期1.1 生命周期 &...
    99+
    2023-06-30
  • vue中的生命周期和钩子函数是什么
    这篇文章主要讲解了“vue中的生命周期和钩子函数是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“vue中的生命周期和钩子函数是什么”吧!1.什么是生命周期Vue 实例有一个完整的生命周期...
    99+
    2023-06-21
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作