daily-share icon indicating copy to clipboard operation
daily-share copied to clipboard

个人博客记录、内容在issues

Results 131 daily-share issues
Sort by recently updated
recently updated
newest added

IOS active 状态失效问题解决方案 ```js useEffect(() => { document.addEventListener('touchstart', () => {}, false); return () => { document.removeEventListener('touchstart', () => {}, false); }; }, []); ```

CSS

```jsx import React, { useEffect, useState } from 'react' import { Button, Avatar, Spin } from 'antd' import { toPng, toJpeg, toBlob, toPixelData, toSvg } from 'html-to-image' import F2 from...

小技巧

```js // 构造函数的参数是一个异步任务 function Promise(task) { // 初始化工作 let that = this // 缓存this that.status = 'pending' // 默认状态为pending that.value = undefined // 此变量是promise的结果,成功的结果或失败的原因 // 成功回调函数 that.onResolvedCallbacks = [] //...

javascript

```tsx import React, { useEffect, useRef, useState } from 'react' import { createUseStyles } from 'react-jss' import AMapLoader from '@amap/amap-jsapi-loader' import zhizhen from '@/assets/images/zhizhen.png' const styles = createUseStyles({ content: {...

插件

## 01 - for ```js const files = [ 'foo.txt ', '.bar', ' ', 'baz.foo' ]; let filePaths = []; for (let file of files) { const fileName = file.trim();...

javascript

![input](https://user-images.githubusercontent.com/42566669/124097044-bfea9d80-da8d-11eb-8bba-9bbae77791ea.gif) ## 效果代码 ```js import React from 'react' import SimulateInput from './component/SimulateInput/SimulateInput' const App = () => { return ( 请输入8位工号 {}} /> 请输入6位工号 {}} /> 请输入6位数密码 {}} /> )...

小技巧

```js import React, { useState, useEffect } from 'react' import { Table } from 'antd' const App = () => { const [tableData, setTableData] = useState([]) const getTableData = ()...

小技巧

## 实现快照沙箱 ```js // 沙箱就是互不影响,创造一个干净的环境, 当切换时,可以选择丢弃属性或恢复属性 // js沙箱 proxy // 快照沙箱 将区别保存起来 class SnpashotSandBox { constructor() { this.proxy = window this.modifyPropsMap = {} this.active() } active() { this.windowSnpashot = {}...

javascript

首先电脑需要全局安装 node-sass ```bash sass index.scss index.css ```

CSS

## redux 数据模型 ```jsx export default { state: { count: 1, flag: false, data: { count: 1, name: 'zs', }, }, reducers: { addCount: (state, number) => { return {...

react