Forráskód Böngészése

style: 适应lint规则

pipipi-pikachu 5 éve
szülő
commit
2f1dd4d776

+ 1 - 1
.eslintrc.js

@@ -45,7 +45,7 @@ module.exports = {
     }],
     'default-case': 'error',
     'consistent-this': ['error', '_this'],
-    'max-depth': ['error', 4],
+    'max-depth': ['error', 5],
     'max-lines': ['error', 800],
     'no-multi-str': 'error',
     'space-infix-ops': 'error',

+ 1 - 1
src/components/ColorPicker/Saturation.vue

@@ -47,7 +47,7 @@ export default defineComponent({
     const pointerTop = computed(() => (-(color.value.v * 100) + 1) + 100 + '%')
     const pointerLeft = computed(() => color.value.s * 100 + '%')
 
-    const emitChangeEvent = throttle(function (param) {
+    const emitChangeEvent = throttle(function(param) {
       emit('colorChange', param)
     }, 20, { leading: true, trailing: false })
 

+ 1 - 1
src/components/Contextmenu/MenuContent.vue

@@ -81,7 +81,7 @@ $subMenuWidth: 120px;
   }
 
   &:hover:not(.disable) {
-    background-color: #e1e1e1;
+    background-color: rgba($color: $themeColor, $alpha: .2);
   }
 
   &.divider {

+ 3 - 3
src/hooks/useHistorySnapshot.ts

@@ -5,15 +5,15 @@ import { ActionTypes, useStore } from '@/store'
 export default () => {
   const store = useStore()
 
-  const addHistorySnapshot = debounce(function () {
+  const addHistorySnapshot = debounce(function() {
     store.dispatch(ActionTypes.ADD_SNAPSHOT)
   }, 300, { trailing: true })
 
-  const redo = throttle(function () {
+  const redo = throttle(function() {
     store.dispatch(ActionTypes.RE_DO)
   }, 100, { leading: true, trailing: false })
 
-  const undo = throttle(function () {
+  const undo = throttle(function() {
     store.dispatch(ActionTypes.UN_DO)
   }, 100, { leading: true, trailing: false })
 

+ 1 - 1
src/views/Screen/index.vue

@@ -175,7 +175,7 @@ export default defineComponent({
       ) execNext()
     }
 
-    const mousewheelListener = throttle(function (e: WheelEvent) {
+    const mousewheelListener = throttle(function(e: WheelEvent) {
       if (e.deltaY < 0) execPrev()
       else if (e.deltaY > 0) execNext()
     }, 500, { leading: true, trailing: false })

+ 1 - 1
src/views/components/element/TableElement/EditableTable.vue

@@ -524,7 +524,7 @@ export default defineComponent({
       }
     }
 
-    const handleInput = debounce(function () {
+    const handleInput = debounce(function() {
       emit('change', tableCells.value)
     }, 300, { trailing: true })
 

+ 2 - 2
src/views/components/element/TextElement/index.vue

@@ -137,7 +137,7 @@ export default defineComponent({
     const handleBlur = () => {
       store.commit(MutationTypes.SET_DISABLE_HOTKEYS_STATE, false)
     }
-    const handleInput = debounce(function () {
+    const handleInput = debounce(function() {
       store.commit(MutationTypes.UPDATE_ELEMENT, {
         id: props.elementInfo.id, 
         props: { content: editorView.dom.innerHTML },
@@ -145,7 +145,7 @@ export default defineComponent({
       addHistorySnapshot()
     }, 300, { trailing: true })
 
-    const handleClick = debounce(function () {
+    const handleClick = debounce(function() {
       const attr = getTextAttrs(editorView)
       emitter.emit(EmitterEvents.UPDATE_TEXT_STATE, attr)
     }, 30, { trailing: true })