摘要:
功能实现:React仿photoshop参考线功能,标尺处拉出参考线,双击参考线或上拉至标尺中消失。 功能截图: index.jsx: import React, { useRef, useEffect, useState } from 'react'; import { v4 } from 'uu 阅读全文
摘要:
react及相关版本: "react": "^18.2.0", "react-dom": "^18.2.0", "react-router": "^6.4.2", "react-router-dom": "^6.4.2" 实现嵌套路由: 目录结构: main.jsx import React fro 阅读全文
摘要:
问题描述: 在组件库开发组件的时候遇到 antd 的 DatePicker 和 RangePicker 组件 ts 错误提示 “DatePicker”不能用作 JSX 组件 。 如图所示: 解决方案: 把 DatePicker 和 RangePicker 组件定义为 any 类型即可。 阅读全文
摘要:
需求: Element plus的树组件实现单选和搜索功能。 效果: 实现: <!-- element plus 树组件实现单选及搜索功能 --> <template> <div class="tree-radio"> <h3>Element plus 树组件实现单选及搜索功能</h3> <hr / 阅读全文
摘要:
开发小程序蓝牙开锁,应用到了16进制相关操作方法,记录一下相关方法。 // ArrayBuffer转16进制字符串 export const ab2hex = (buffer) => { const hexArr = Array.prototype.map.call( new Uint8Array( 阅读全文
摘要:
开发小程序蓝牙开锁,应用到了 aes-128 算法加解密,记录一下相关方法。 aes.js // aes 算法处理 var t = t || function(t, e) { var r = {}, i = r.lib = {}, n = function() {}, o = i.Base = { 阅读全文
摘要:
组件名:checkbox-select 组件截图: 文件内容: src/pages/checkbox-select/index.js import CheckboxSelect from 'components/checkbox-select'; function Page() { // 演示数据 阅读全文
摘要:
功能需求:加载多图片项目的时候,想提供一个loading页面,让用户知道加载进度。 实现代码: import React, {useEffect, useState} from 'react'; const imgLoad = ()=>{ // 要加载的图片资源 const picList = [ 阅读全文
摘要:
功能需求:有时候往往需要一个范围区间显示一个值。 解决思路:一般正常设置,只能一个刻度对应一个值。那么则需要使用两个x轴来解决即可。 效果展示: 代码实现: const time = ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00']; co 阅读全文
摘要:
index.less 1 .amap-logo, 2 .amap-copyright { 3 display: none !important; 4 } 5 6 #container { 7 width: 600px; 8 height: 600px; 9 } 10 11 @keyframes fa 阅读全文