摘要: import React, { Component } from 'react' var Hoc = (Com) => { return class extends React.Component { render() { return <><Com {...this.props} />2020 & 阅读全文
posted @ 2020-02-26 22:29 冬冬先生 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 配置代理: 安装 yarn add http-proxy-middleware 创建文件的路径 src/setupProxy.js const { createProxyMiddleware } = require('http-proxy-middleware') module.exports = 阅读全文
posted @ 2020-02-26 22:26 冬冬先生 阅读(235) 评论(0) 推荐(0) 编辑
摘要: ui库 ant design mobile 移动端 ant design pc端 yarn add antd 安装这个第三方的插件 全局引入(不推荐): 路口文件:import 'antd/dist/antd.css'; 组件里: import { Button } from 'antd'; <Bu 阅读全文
posted @ 2020-02-26 22:23 冬冬先生 阅读(1029) 评论(0) 推荐(0) 编辑
摘要: function time(time = +new Date()) { var date = new Date(time + 8 * 3600 * 1000); // 增加8小时 return date.toJSON().substr(0, 19).replace('T', ' '); consol 阅读全文
posted @ 2020-01-11 15:25 冬冬先生 阅读(530) 评论(0) 推荐(0) 编辑
摘要: H5的新特新 1.语义化的标签:header、footer、section、nav、aside、article 标签 描述 header 定义文档的头部区域 footer 定义文档的尾部区域 nav 定义文档的导航栏部分 section 定义文档中的节(section、区段) article 定义页 阅读全文
posted @ 2019-12-27 13:12 冬冬先生 阅读(727) 评论(0) 推荐(0) 编辑
摘要: Mongoose是在node.js异步环境下对mongodb进行便捷操作的对象模型工具 get提交的数据后端接口用req.query接收 post提交数据后端接口用req.body接收 增删改查 const mongoose = require('mongoose'); mongoose.conne 阅读全文
posted @ 2019-12-25 18:02 冬冬先生 阅读(664) 评论(0) 推荐(0) 编辑
摘要: Node.js的框架 express: 基于Node.js平台,快速、开发、极简的Web开发框架 类似的框架:koa2 eggs adonis 路由(router) 后端: 根据不同用户请求,返回不同的内容 中间件: 路由级的中间件,应用级的中间件 path内置的模块: 加密的内置模块:crypto 阅读全文
posted @ 2019-12-25 14:09 冬冬先生 阅读(437) 评论(0) 推荐(0) 编辑
摘要: mongodb是一个非关系型的数据库管理系统(dbms) 存的值是键值对 key:value (bson) 开机命令:mongod --dbpath d:/data 看到27017就表示开机成功了,这个窗口不能关闭。 再打开一个窗口 mongo; show dbs 查看数据库 exit 退出数据库 阅读全文
posted @ 2019-12-25 14:08 冬冬先生 阅读(404) 评论(0) 推荐(0) 编辑
摘要: yarn add ejs安装这个第三方的模块 <%=变量%> 转义输出 <%-变量%> 不转义输出 <%js代码%> 用来包裹js代码 路口文件:渲染的是 views目录下面的dong.js模板 const express =require("express"); var app =express( 阅读全文
posted @ 2019-12-25 14:07 冬冬先生 阅读(602) 评论(0) 推荐(0) 编辑
摘要: cheerio第三方的模块:cheerio是jquery核心功能的一个快速灵活而又简洁的实现,主要是为了用在服务器端需要对DOM进行操作的地方 用http模块做爬虫爬取网页的新闻: const http =require("http"); const fs =require("fs"); const 阅读全文
posted @ 2019-12-25 11:39 冬冬先生 阅读(251) 评论(0) 推荐(0) 编辑