08 2020 档案
摘要:axios里面可以设置拦截器 ,在请求发送之前做一些事情; 拦截器分【请求拦截器】和【响应拦截器】 参考地址:https://www.jb51.net/article/150014.htm 参考的地址:https://www.jianshu.com/p/7bc7654d4574 请求拦截器的实际应用
阅读全文
摘要:在app.vue下,引入 <style> @font-face { font-family: 'iconfont'; /* project id 1951514 */ src: url('https://at.alicdn.com/t/font_1951514_c10bgx9xy2l.eot');
阅读全文
摘要:import React, { Component } from "react"; export default class Shengming extends Component { // 调用父类的 constructor方法;传递props属性,染发props属性起作用 constructor
阅读全文
摘要:react的生命周期,分为3三个阶段, 挂载阶段 constructor(){} UNSAFE_componentWillMount(){} == componentWillMount(在17版本中将废除){} componentDidMount(){ 发送异步请求的} render(){} 跟新:
阅读全文
摘要:子组件 import React, { Component } from 'react'; class Web1 extends Component { constructor(props) { super(props); this.state = { num:100, } } son(){ thi
阅读全文
摘要:爷爷组件 import React, { Component } from "react"; import "./App.css"; import TestHanderClick from "./components/TestHanderClick"; import proptypeskey fro
阅读全文
摘要:首先你需要下载 cnpm i prop-types 安装验证数据类型的插件; 子组件 import React, { Component } from "react"; import "./base.css"; // 引入验证格式类型的插件 import proptypeskey from "pro
阅读全文
摘要:<input type="file" @change="demo"> if(e.target.files[0]&&e.target.files[0].type.indexOf("mp4")!=-1){//检查视频 console.log("e",e.target.files[0].type);//这
阅读全文
摘要:父组件 <TestHanderClick bg="blue"> <p> 如果我要显示的话,父组件是双标签,子组件中有this.props.children</p> <div>类似于匿名插槽</div> </TestHanderClick> 子组件 import React, { Component
阅读全文
摘要:子组件 import React, { Component } from "react"; import "./base.css" // 父组件 export class TestHanderClick extends Component { // static defaultProps是默认的写法
阅读全文
摘要:给当前元素添加一个类是通过className来处理的; 引入css;直接from XXXX import React, { Component } from "react"; // 以内css,直接form import "./base.css" export class TestHanderCli
阅读全文
摘要:import React, { Component } from "react"; export class TestHanderClick extends Component { constructor(props) { super(props); this.state = { cont: "内容
阅读全文
摘要:执行如下: npm install -g react npm install react --save 类似这种依赖项(react,react-dom 等)报错,哪个报错执行哪个即可 执行上述两句就 ok 啦
阅读全文
摘要:我发现 state 有两种不同的写法 在构造器 constructor 中是这样的 有 this. constructor(props){//参数必须要有 super(props); this.state={ num:10 } } } 没有 constructor state={ num:10 }
阅读全文
摘要:现在安装 react 脚手架的有三种, react-boilerplate react-redux-starter-kit create-react-app(国内主要运用这一种) 1==>npm install -g create-react-app 全局安装脚手架命令(第一次安装后就不需要在重新安
阅读全文
摘要:import React, { Component } from "react"; export class TestHanderClick extends Component { //有构造器state写在里面, 构造器中必须要有super并且传递参数 constructor(props) { s
阅读全文