feat: 📦 lodash to lodash-es

This commit is contained in:
FairyEver 2020-11-17 08:32:46 +08:00
parent 790f69a751
commit f53927121e
25 changed files with 307 additions and 299 deletions

View File

@ -7,7 +7,6 @@ module.exports = [
{ name: 'better-scroll', library: 'BScroll', js: 'https://cdn.jsdelivr.net/npm/better-scroll@1.15.2/dist/bscroll.min.js', css: '' },
{ name: 'element-ui', library: 'ELEMENT', js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js', css: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/theme-chalk/index.css' },
{ name: 'axios-mock-adapter', library: 'AxiosMockAdapter', js: 'https://cdn.jsdelivr.net/npm/axios-mock-adapter@1.18.1/dist/axios-mock-adapter.min.js', css: '' },
{ name: 'lodash', library: '_', js: 'https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js', css: '' },
{ name: 'ua-parser-js', library: 'UAParser', js: 'https://cdn.jsdelivr.net/npm/ua-parser-js@0.7.20/dist/ua-parser.min.js', css: '' },
{ name: 'js-cookie', library: 'Cookies', js: 'https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js', css: '' },
{ name: 'nprogress', library: 'NProgress', js: 'https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js', css: 'https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.css' },

557
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@
"highlight.js": "^10.0.2",
"hotkeys-js": "^3.7.3",
"js-cookie": "^2.2.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"lowdb": "^1.0.0",
"marked": "^1.0.0",
"nprogress": "^0.2.0",

View File

@ -1,4 +1,4 @@
import { assign, map } from 'lodash'
import { assign, map } from 'lodash-es'
import faker from 'faker/locale/zh_CN'
import { service, request, serviceForMock, requestForMock, mock } from './service'
import * as tools from './tools'

View File

@ -1,4 +1,4 @@
import { find, map, random } from 'lodash'
import { find, map, random } from 'lodash-es'
const businessIssue142Db = [
{ id: '1', name: '用户 1', address: '上海市普陀区金沙江路 1518 弄' },

View File

@ -1,4 +1,4 @@
import { find, assign } from 'lodash'
import { find, assign } from 'lodash-es'
const users = [
{ username: 'admin', password: 'admin', uuid: 'admin-uuid', name: 'Admin' },

View File

@ -1,6 +1,6 @@
import axios from 'axios'
import Adapter from 'axios-mock-adapter'
import { get } from 'lodash'
import { get } from 'lodash-es'
import util from '@/libs/util'
import { errorLog, errorCreate } from './tools'

View File

@ -9,7 +9,7 @@
</template>
<script>
import { last, get } from 'lodash'
import { last, get } from 'lodash-es'
export default {
data () {
return {

View File

@ -1,7 +1,7 @@
// 提供滚动方面的功能
// 非滚动优化模式通用
import { throttle } from 'lodash'
import { throttle } from 'lodash-es'
// 生成滚动事件的 handler
function handleMaker (wait) {

View File

@ -1,4 +1,4 @@
import { throttle } from 'lodash'
import { throttle } from 'lodash-es'
import { mapState } from 'vuex'
import menuMixin from '../mixin/menu'
import { createMenu } from '../libs/util.menu'

View File

@ -1,7 +1,7 @@
import low from 'lowdb'
import LocalStorage from 'lowdb/adapters/LocalStorage'
import util from '@/libs/util'
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash-es'
const adapter = new LocalStorage(`d2admin-${process.env.VUE_APP_VERSION}`)
const db = low(adapter)

View File

@ -1,4 +1,4 @@
import { uniqueId } from 'lodash'
import { uniqueId } from 'lodash-es'
// 插件
import demoPlugins from './modules/demo-plugins'

View File

@ -1,4 +1,4 @@
import { get, isObject } from 'lodash'
import { get, isObject } from 'lodash-es'
import store from '@/store'
import util from '@/libs/util'

View File

@ -1,4 +1,4 @@
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash-es'
import client from 'webpack-theme-color-replacer/client'
import forElementUI from 'webpack-theme-color-replacer/forElementUI'

View File

@ -1,5 +1,5 @@
import router from '@/router'
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash-es'
import { database as getDatabase, dbGet, dbSet } from '@/libs/util.db'
export default {

View File

@ -1,5 +1,5 @@
import dayjs from 'dayjs'
import { get } from 'lodash'
import { get } from 'lodash-es'
import util from '@/libs/util.js'
export default {

View File

@ -1,4 +1,4 @@
import { cloneDeep, uniq, get } from 'lodash'
import { cloneDeep, uniq, get } from 'lodash-es'
import router from '@/router'
import setting from '@/setting.js'

View File

@ -1,4 +1,4 @@
import { get } from 'lodash'
import { get } from 'lodash-es'
import setting from '@/setting.js'
export default {

View File

@ -21,7 +21,7 @@
</template>
<script>
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash-es'
import { mapState, mapMutations } from 'vuex'
import { frameInRoutes } from '@/router/routes'
import layoutHeaderAside from '@/layout/header-aside'

View File

@ -41,7 +41,7 @@
</template>
<script>
import { uniqueId } from 'lodash'
import { uniqueId } from 'lodash-es'
import { mapActions } from 'vuex'
export default {
data () {

View File

@ -43,7 +43,7 @@
</template>
<script>
import { uniqueId } from 'lodash'
import { uniqueId } from 'lodash-es'
import { mapActions } from 'vuex'
export default {
data () {

View File

@ -37,7 +37,7 @@
</template>
<script>
import { uniqueId } from 'lodash'
import { uniqueId } from 'lodash-es'
import { mapActions } from 'vuex'
export default {
data () {

View File

@ -39,7 +39,7 @@
</template>
<script>
import { uniqueId } from 'lodash'
import { uniqueId } from 'lodash-es'
import { mapActions } from 'vuex'
export default {
data () {

View File

@ -21,7 +21,7 @@
</template>
<script>
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash-es'
import { mapState, mapMutations, mapActions } from 'vuex'
export default {
data () {

View File

@ -70,7 +70,7 @@
<script>
import { mapState } from 'vuex'
import { get } from 'lodash'
import { get } from 'lodash-es'
export default {
data () {
return {