上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 142 下一页
摘要: 1.代码 function App () { const [ count, setCount ] = useState(0) const [ width, setWidth ] = useState(document.body.clientWidth) const onChange = () => 阅读全文
posted @ 2020-04-01 12:00 每天都要进步一点点 阅读(7789) 评论(0) 推荐(0)
摘要: 1.前端下载 (1)封装工具类 utils/exportXLSX.tsx import * as XLSX from 'xlsx'; /** * 纯前端将数据导出成XLSX文件 * @param {string} fileName 导出的XLSX文件名 * @param {string} sheet 阅读全文
posted @ 2020-03-31 12:00 每天都要进步一点点 阅读(1468) 评论(0) 推荐(0)
摘要: 1.安装 xlsx yarn add xlsx --save-dev 2.创建工具类 app/controller/tools.js 'use strict'; const Controller = require('egg').Controller; const XLSX = require('x 阅读全文
posted @ 2020-03-30 12:00 每天都要进步一点点 阅读(2007) 评论(0) 推荐(0)
摘要: 1.计算公式 offset=page*limit-limit 2.代码 /** * 分页查询 * @param offset 起始页 * @param limit 每页展示条数 * offset=page*limit-limit */ const query = { offset: app.toIn 阅读全文
posted @ 2020-03-29 12:00 每天都要进步一点点 阅读(2540) 评论(0) 推荐(0)
摘要: 1.代码 return await app.model.Diary.findAndCountAll({ order:[['updatedAt', 'DESC']] }); . 阅读全文
posted @ 2020-03-28 12:00 每天都要进步一点点 阅读(336) 评论(0) 推荐(0)
摘要: 1.封装组件 components/Scroll/index.tsx /** * 下拉刷新 上拉加载更多 */ import React, { forwardRef, useState,useEffect, useRef, useImperativeHandle, useMemo } from "r 阅读全文
posted @ 2020-03-27 12:00 每天都要进步一点点 阅读(5654) 评论(4) 推荐(3)
摘要: 安装: npm i egg-http-proxy --save // 或 yarn add egg-http-proxy 导入到egg项目里: // 在config/plugin.js里面添加 exports.httpProxy = { enable: true, package: 'egg-htt 阅读全文
posted @ 2020-03-26 12:00 每天都要进步一点点 阅读(5785) 评论(0) 推荐(0)
摘要: config-overrides.js const { override, fixBabelImports, addLessLoader, addWebpackAlias } = require('customize-cra'); const path = require('path'); func 阅读全文
posted @ 2020-03-25 12:00 每天都要进步一点点 阅读(1681) 评论(0) 推荐(0)
摘要: 1.安装模块 yarn add react-cropper lrz 2.分装组件 src/components/ImgCropper/index.tsx /** * 上传logo组件 */ import * as React from 'react'; import { Upload, Icon, 阅读全文
posted @ 2020-03-24 12:00 每天都要进步一点点 阅读(3144) 评论(0) 推荐(0)
摘要: 1.安装模块 npm install qrcode-react // 或者 yarn add qrcode-react 2.属性介绍 size 二维码大小 numberbgColor 二维码背景色string (CSS颜色)"#FFFFFF"fgColor 颜色 string (CSS颜色)logo 阅读全文
posted @ 2020-03-23 12:00 每天都要进步一点点 阅读(1991) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 142 下一页