refactor: 调整lodash引入方式

This commit is contained in:
pipipi-pikachu 2021-06-09 22:14:52 +08:00
parent 2b18c36f84
commit bc9193e6b5
13 changed files with 13 additions and 17 deletions

View File

@ -21,8 +21,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onUnmounted, PropType, ref } from 'vue' import { computed, defineComponent, onUnmounted, PropType, ref } from 'vue'
import tinycolor, { ColorFormats } from 'tinycolor2' import tinycolor, { ColorFormats } from 'tinycolor2'
import throttle from 'lodash/throttle' import { throttle, clamp } from 'lodash'
import clamp from 'lodash/clamp'
export default defineComponent({ export default defineComponent({
name: 'saturation', name: 'saturation',

View File

@ -73,7 +73,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onMounted, ref, watch } from 'vue' import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import tinycolor, { ColorFormats } from 'tinycolor2' import tinycolor, { ColorFormats } from 'tinycolor2'
import debounce from 'lodash/debounce' import { debounce } from 'lodash'
import Alpha from './Alpha.vue' import Alpha from './Alpha.vue'
import Checkboard from './Checkboard.vue' import Checkboard from './Checkboard.vue'

View File

@ -1,5 +1,4 @@
import debounce from 'lodash/debounce' import { debounce, throttle} from 'lodash'
import throttle from 'lodash/throttle'
import { ActionTypes, useStore } from '@/store' import { ActionTypes, useStore } from '@/store'
export default () => { export default () => {

View File

@ -1,5 +1,5 @@
import { MutationTree } from 'vuex' import { MutationTree } from 'vuex'
import omit from 'lodash/omit' import { omit } from 'lodash'
import { MutationTypes } from './constants' import { MutationTypes } from './constants'
import { State } from './state' import { State } from './state'
import { Slide, PPTElement, SlideTheme } from '@/types/slides' import { Slide, PPTElement, SlideTheme } from '@/types/slides'

View File

@ -1,4 +1,4 @@
import padStart from 'lodash/padStart' import { padStart } from 'lodash'
/** /**
* *

View File

@ -1,5 +1,4 @@
import startsWith from 'lodash/startsWith' import { startsWith, endsWith } from 'lodash'
import endsWith from 'lodash/endsWith'
import { Token } from './types' import { Token } from './types'
import { childlessTags } from './tags' import { childlessTags } from './tags'

View File

@ -1,5 +1,5 @@
import { Ref, computed } from 'vue' import { Ref, computed } from 'vue'
import uniq from 'lodash/uniq' import { uniq } from 'lodash'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { PPTElement } from '@/types/slides' import { PPTElement } from '@/types/slides'

View File

@ -76,7 +76,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, provide, ref, watch, watchEffect } from 'vue' import { computed, defineComponent, provide, ref, watch, watchEffect } from 'vue'
import throttle from 'lodash/throttle' import { throttle } from 'lodash'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { ContextmenuItem } from '@/components/Contextmenu/types' import { ContextmenuItem } from '@/components/Contextmenu/types'
import { PPTElement, Slide } from '@/types/slides' import { PPTElement, Slide } from '@/types/slides'

View File

@ -133,7 +133,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, ref, watch } from 'vue' import { computed, defineComponent, ref, watch } from 'vue'
import round from 'lodash/round' import { round } from 'lodash'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { PPTElement } from '@/types/slides' import { PPTElement } from '@/types/slides'
import { MIN_SIZE } from '@/configs/element' import { MIN_SIZE } from '@/configs/element'

View File

@ -57,7 +57,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onMounted, onUnmounted, provide, ref } from 'vue' import { computed, defineComponent, onMounted, onUnmounted, provide, ref } from 'vue'
import throttle from 'lodash/throttle' import { throttle } from 'lodash'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { Slide } from '@/types/slides' import { Slide } from '@/types/slides'
import { VIEWPORT_SIZE } from '@/configs/canvas' import { VIEWPORT_SIZE } from '@/configs/canvas'

View File

@ -14,7 +14,7 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, inject, onMounted, PropType, ref, Ref, watch } from 'vue' import { defineComponent, inject, onMounted, PropType, ref, Ref, watch } from 'vue'
import upperFirst from 'lodash/upperFirst' import { upperFirst } from 'lodash'
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import Chartist, { import Chartist, {
IChartistLineChart, IChartistLineChart,

View File

@ -72,8 +72,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue' import { computed, defineComponent, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
import debounce from 'lodash/debounce' import { debounce, isEqual } from 'lodash'
import isEqual from 'lodash/isEqual'
import { useStore } from '@/store' import { useStore } from '@/store'
import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides' import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'
import { ContextmenuItem } from '@/components/Contextmenu/types' import { ContextmenuItem } from '@/components/Contextmenu/types'

View File

@ -44,7 +44,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onMounted, onUnmounted, PropType, ref, watch } from 'vue' import { computed, defineComponent, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
import debounce from 'lodash/debounce' import { debounce } from 'lodash'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { EditorView } from 'prosemirror-view' import { EditorView } from 'prosemirror-view'
import { toggleMark, wrapIn, selectAll } from 'prosemirror-commands' import { toggleMark, wrapIn, selectAll } from 'prosemirror-commands'