style: 适应lint规则

This commit is contained in:
pipipi-pikachu 2021-02-06 13:56:09 +08:00
parent c0a15d6e0d
commit 2f1dd4d776
7 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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