一、使用setState现象 1.不可变值 class StateDemo extends React.Component { constructor(props) { super(props) this.state = { count: 0 } } render() { return <div> ...
分类:
其他好文 时间:
2020-07-04 20:55:55
阅读次数:
77
1.JSX的使用 class JSXBaseDemo extends React.Component { constructor(props) { super(props) this.state = { name: 'xiaoming', imgUrl: 'https://img1.mukewang ...
分类:
Web程序 时间:
2020-07-04 20:48:13
阅读次数:
84
1.react父子组件之间通过props传递数据,通过callback回调子组件向父组件通信, 我们看下面的伪代码: class TodoListDemo extends React.Component { constructor(props) { super(props) // 状态(数据)提升 ...
分类:
其他好文 时间:
2020-07-04 20:45:48
阅读次数:
67
spring组件的构造器参好神奇 这里有一个接口:FruitService和两个实现类:AppleService、BananaService,假设我想在其中一个实现类实例化中获取当前Spring容器的Bean怎么办? 只需要重写该实现类的构造方法: @Component public class A ...
分类:
编程语言 时间:
2020-07-04 19:08:11
阅读次数:
78
React路由传参的三种方式 方式 一: 通过params 1.路由表中 <Route path=' /sort/:id ' component={Sort}></Route> 2.Link处 HTML方式 <Link to={ ' /sort/ ' + ' 2 ' } activeClassNam ...
分类:
其他好文 时间:
2020-07-04 18:42:03
阅读次数:
57
一,父组件给子组件传值 1,父组件调用子组件的时候传入数据 <app-header [msg]="msg"></app-header> 2,子组件引入Input模块 import { Component, OnInit ,Input } from '@angular/core'; 3,子组件中@In ...
分类:
其他好文 时间:
2020-07-04 17:17:25
阅读次数:
69
1.编写切面类 @Component @Aspect @Slf4j public class SellerAuthorizeAspect { @Autowired StringRedisTemplate stringRedisTemplate; @Pointcut(value = "executio ...
分类:
编程语言 时间:
2020-07-04 16:55:54
阅读次数:
133
错误日志: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHos ...
分类:
编程语言 时间:
2020-07-03 19:52:09
阅读次数:
84
写在前面 在 React 中,定义组件的方式有两种,一个是 class 类组件,一个是函数组件。class 类组件的实现相比于函数组件要复杂。 1. return React 元素 React 组件必须是返回 React 元素的物件,因此无论是函数组件还是类组件都必须有 return React元素 ...
分类:
其他好文 时间:
2020-07-03 15:19:33
阅读次数:
79
1.引入了前缀,解决了前缀问题 http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd 组件扫描 将组件扫描<context:component-scan b ...
分类:
移动开发 时间:
2020-07-03 01:19:01
阅读次数:
91