![](https://img-blog.csdnimg.cn/20190918140053667.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
React
一起来学React
Hao.Zhou
我不懒,但我什么都没有写
展开
-
react hooks useEffect 执行两次解决方案
useEffect(() => { const timeout = setTimeout(() => verifyIsLogin(), 300); return () => clearTimeout(timeout); async function verifyIsLogin() { }; // verifyIsLogin(); }, []);原创 2021-06-21 16:45:13 · 8689 阅读 · 0 评论 -
XLSX+ANT Upload实现从EXCEL导入数据操作
import { Button, Table, Upload, Icon} from 'antd'; <Upload onChange={(e) => { this.onFileChange(e); }} beforeUplo原创 2021-06-03 18:35:34 · 436 阅读 · 0 评论 -
React Ant-Table Resizable 实现对Table表格的列的宽度调整
import React from "react";import { Widget } from "erpcore";import { Table } from 'antd';import "./index.less";import { Resizable } from 'react-resizable';import 'react-resizable/css/styles.css';const WidgetOfBase = Widget.WidgetOfBase;const Resize原创 2021-05-13 16:58:30 · 2037 阅读 · 8 评论 -
基于excel.js 面向对象实现Excel的生成以及导出(完整表格·带图片)
效果如下excel.js(生成Excel的json文件)import ERPUtil from "./erpUtil";const Excel = require('exceljs');export class ERPExcelCell { row = null; key = null; block = null; excelCell = null; beMerged = false; value = null; // excel原创 2020-11-26 15:57:10 · 1147 阅读 · 1 评论 -
react利用exceljs实现table表格的导出(带图片,样式)
比较难看的代码,主要是为了实现带图片,带样式的table导出,希望哪位大佬有其他方法可以私信我//引入exceljsconst Excel = require('exceljs'); // 导出excel downloadExcel = () => { let dataLength = 0; this.state.dataItems.forEach(floor => { floor.rooms.forEach(room =&.原创 2020-10-23 17:48:45 · 2991 阅读 · 0 评论 -
React(onRef)父组件调用子组件中的方法
import React, {Component} from 'react';import {Text, View, TouchableOpacity} from 'react-native';export default class Parent extends Component { render() { return( <View> <Child onRef={(ref)=>{this.ch原创 2020-06-05 17:37:37 · 2222 阅读 · 0 评论 -
Echarts(react)实现中国地图的引入以及使用
事实上,只需要将Echarts官网提供的series[ { mapType: ‘china’} ]就可以简单实现import React from "react";import EChartBase from "./EChartBase";import echarts from 'echarts/lib/echarts';import 'echarts/map/js/china';import geoJson from 'echarts/map/json/china.json';class原创 2020-06-04 15:02:31 · 5254 阅读 · 1 评论 -
react下数据请求后swiper不能滑动的问题
import React, { Component } from 'react';import CSS from './index.module.less';import Swiper from 'swiper';class MenuBar extends Component { constructor(props) { super(props); ...原创 2020-02-25 13:31:57 · 778 阅读 · 0 评论 -
react自定义组件无法单击问题/出现自动单击效果
自定义的组件➡️import React from "react"import css from "./index.module.less"const ModelList = (props) => { const { imgsrc, title, points, collects, onClick } = props; return ( <div ...原创 2020-02-11 16:56:51 · 457 阅读 · 0 评论