react
爱技术的大仙
一个热爱后端的大前端
展开
-
table trtd tbody
<template> <div class="view-table"> <table border="1" > <tr class="tr"> <td>指标名称</td> <td>时间</td> <td>指标状态</td> <td>企业数量</td> <原创 2022-05-24 15:06:25 · 167 阅读 · 0 评论 -
反转按钮点击两次第一次获取值第二次为空
import React from 'react';import {Button} from "antd";const Demo = () => { let lastVal =null // 记录下上次的值 const getValue = (val) => { const thisValue = lastVal ==val ?'' :val // 先把上次的值传给这次 lastVal =thisValue原创 2022-05-23 21:05:28 · 138 阅读 · 0 评论 -
原生打印js
import React from 'react';import {Button} from "antd";class Example extends React.Component { constructor(props) { super(props); this.state = { printType: 1, }; } // 原生打印 printPartFn = () => {..原创 2022-05-20 23:49:17 · 469 阅读 · 0 评论 -
多文件上传,文件夹上传
<template> <div> <el-upload v-loading="loading" class="upload-demo" action="*" :on-remove="fileRemove" :on-change="fileChang" :http-request="uploadFile" accept="" :before-原创 2022-05-18 23:07:55 · 342 阅读 · 0 评论 -
vue实现列表自动滚动、向上滚动的效果(vue-seamless-scroll)
第一步进行安装npm install vue-seamless-scroll --save - 在main.js直接导入使用```javascriptimport scroll from 'vue-seamless-scroll'Vue.use(scroll) - 建立了一个Test.vue来使用(结合element-ui中的表格来一起实现的)```javascript<template> <div id="app"> <div class..原创 2022-05-12 21:57:27 · 3040 阅读 · 2 评论 -
多功能React影像组件(拖拽、水印、缩放、切换、旋转)
yarn add cxj-react-image// npm i cxj-react-image**import ImageModal from 'cxj-react-image'; <ImageModal src={imageList[currentImageIndex]} {/* 当前图片路径 */} next={() => this.next()} {/* 控制下一张 */} prev={() => this.prev()}原创 2022-05-03 00:57:28 · 628 阅读 · 0 评论 -
React基于antd Table实现可拖拽调整列宽的表格
实现功能1:表格列宽初始自动分配、列宽总和不能超过容器宽度(无横向滚动条,公司项目特殊需求)2:当容器宽度变化时,保持当前列宽的分配比例,等比缩小3:拖动过程中不进行列宽的调整,只有释放之后再进行列宽调整效果图见目录结构:在这里插入代码片useTableCol.tsx: 处理表格列的宽度计算等相关逻辑import { useMemoizedFn, useSafeState } from 'ahooks';import type { ColumnType } from 'antd/es/ta原创 2022-04-30 16:57:59 · 3802 阅读 · 0 评论