如何引入对象,方法,变量的规范

以 lodash 为例

  • 不推荐
import lodash from 'lodash'
lodash.isUndefined()
  • 不推荐
import { isUndefined } from 'lodash'
isUndefined()
  • 推荐
import isUndefined from 'lodash/isUndefined'
import isString from 'lodash/isString'

isUndefined()
isString()

results matching ""

    No results matching ""