添加vue eslint规则,修复问题
This commit is contained in:
@@ -39,7 +39,7 @@ export default {
|
||||
return this.confirmButtonText || this.$t('confirm_button_text')
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const el = this.$el
|
||||
el.parentNode.removeChild(el)
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user