-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
当前导入方式会把整个lodash整体引入(未压缩是500多kb)
Line 4 in ffc2d12
| import { isFunction } from 'lodash'; |
最好改写成
import isFunction from 'lodash/isFunction',按需导入。或者直接使用原生的
if(onChange && typeof onChange === 'function')进行判断。
另外styled-components我觉得也可以直接用行内样式代替。
Lines 1 to 5 in ffc2d12
| import styled from 'styled-components'; | |
| export const SCaptcha = styled.canvas` | |
| cursor: pointer; | |
| `; |
为了一个样式去引入一个二十多kb的依赖得不偿失。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels