添加vue eslint规则,修复问题

This commit is contained in:
lyswhut
2021-12-03 23:45:03 +08:00
parent ccd951b5d3
commit 1ab5db8507
35 changed files with 198 additions and 175 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ export default {
return this.confirmButtonText || this.$t('confirm_button_text')
},
},
beforeDestroy() {
beforeUnmount() {
const el = this.$el
el.parentNode.removeChild(el)
},
-24
View File
@@ -1,24 +0,0 @@
import { onBeforeUnmount, ref, computed, useI18n, watch, useCommit } from '@renderer/utils/vueTools'
import { formatPlayTime2 } from '@renderer/utils'
import { setLoopPlay } from '../player'
export default ({ setting }) => {
const { t } = useI18n()
const toggleDesktopLyricBtnTitle = computed(() => {
return `${
setting.value.desktopLyric.enable
? t('desktop_lyric__off')
: t('desktop_lyric__on')
}(${
setting.value.desktopLyric.isLock
? t('desktop_lyric__unlock')
: t('desktop_lyric__lock')
})`
})
return {
toggleDesktopLyricBtnTitle,
}
}
-48
View File
@@ -1,48 +0,0 @@
import { useRefGetter, reactive, computed, watch, useCommit } from '@renderer/utils/vueTools'
import Lyric from '@renderer/utils/lyric-font-player'
import { getCurrentTime } from '@renderer/plugins/player'
import { setDesktopLyricInfo } from '@renderer/utils/tools'
// let lrc = window.lrc
export default ({ setting, musicInfo, isPlay, listId, setStatusText }) => {
const lyric = reactive({
lines: [],
text: '',
line: 0,
})
const lrc = window.lrc = new Lyric({
lineClassName: 'lrc-content',
fontClassName: 'font',
shadowContent: false,
activeLineClassName: 'active',
onPlay: (line, text) => {
lyric.text = text
lyric.line = line
setStatusText(text)
// console.log(line, text)
},
onSetLyric: lines => { // listening lyrics seting event
// console.log(lines) // lines is array of all lyric text
lyric.lines = lines
lyric.line = 0
},
// offset: 80,
})
const setLyric = () => {
lrc.setLyric(
setting.value.player.isPlayLxlrc && musicInfo.value.lxlrc ? musicInfo.vlaue.lxlrc : musicInfo.vlaue.lrc,
setting.value.player.isShowLyricTranslation && musicInfo.value.tlrc ? musicInfo.value.tlrc : '',
)
if (isPlay.value && (musicInfo.value.url || listId.value == 'download')) {
const time = getCurrentTime() * 1000
setDesktopLyricInfo('play', time)
lrc.play(time)
}
}
watch(setting.value.player.isShowLyricTranslation, setLyric)
watch(setting.value.player.isPlayLxlrc, setLyric)
}