上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页
摘要: 前端延时随机函数模拟抽奖 点击按钮,模拟抽奖 延时1s返回结果 效果: 普通的使用回调方式的实现 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" con 阅读全文
posted @ 2021-05-20 20:33 pangqianjin 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 设置一个标识位,表示是否正在发送请求let isSending = false 具体代码: // 1.创建对象 let xhr = null let isSending = false const btn = document.getElementsByTagName('button')[0] bt 阅读全文
posted @ 2021-05-20 19:20 pangqianjin 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 如果只使用类式组件,满足以下功能很容易: 在组件挂载时,启动定时器,每隔1s加1; 组件将要卸载时,停止定时器 点击按钮卸载组件 具体实现: import React, { Component } from 'react' import ReactDOM from 'react-dom' expor 阅读全文
posted @ 2021-05-19 18:24 pangqianjin 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 一、首先写一个server.js,用于模拟服务器,并启动 // 1.引入express const express = require('express') // 2.创建express应用对象 const app = express(); // 为了使用req.body解析post请求的参数 ap 阅读全文
posted @ 2021-05-15 15:13 pangqianjin 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 安装pubsub-js 使用npm安装:npm install pubsub-js 使用yarn安装:yarn add pubsub-js 引入 import PubSub from 'pubsub-js' // or when using CommonJS const PubSub = requi 阅读全文
posted @ 2021-05-11 18:14 pangqianjin 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 一、在src目录下建立setupProxy.js, 使用CJS(common JS)语法配置代理,适合一个或多个代理 const proxy = require('http-proxy-middleware') module.exports = function(app){ app.use(//传入 阅读全文
posted @ 2021-05-09 16:19 pangqianjin 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 小例子: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Hello React!</title> <script src="https://cdn.staticfile.org/react/16.4.0/umd/react 阅读全文
posted @ 2021-04-25 16:48 pangqianjin 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 定义虚拟DOM时,不要写引号; 标签中混入JS表达式时要用; 样式的类名指定不要用class,要用className; 内联样式,要用style={{key:value, key:value}}的形式去写; 虚拟DOM只有一个根标签 标签必须闭合 标签首字母: 1)小写开头时,将该标签转为HTML中 阅读全文
posted @ 2021-04-25 15:01 pangqianjin 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Hello React! 首先引入了三个库: react.development.min.js 、react-dom.development.min.js 和 babel.min.js: react.min.js - React 的核心库 react-dom.min.js - 提供与 DOM 相关的 阅读全文
posted @ 2021-04-25 14:23 pangqianjin 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 1. 简介 SpringBoot框架基于Spring4.0设计,由Piovotal公司设计。 VMware+EMC+通用电气->Pivotal公司 2014年 Spring Boot1.0,基于Spring4.0 2015年 Spring Cloud 2018年 Spring Boot2.0,基于S 阅读全文
posted @ 2021-04-15 12:50 pangqianjin 阅读(190) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页