添加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
@@ -192,7 +192,7 @@ export default {
created() {
this.listenEvent()
},
beforeDestroy() {
beforeUnmount() {
this.unlistenEvent()
},
methods: {
+1 -1
View File
@@ -120,7 +120,7 @@ export default {
created() {
this.listenEvent()
},
beforeDestroy() {
beforeUnmount() {
this.unlistenEvent()
},
mounted() {
+3 -3
View File
@@ -1,6 +1,6 @@
<template>
<div id="my-list" :class="$style.container" @click="handleContainerClick" v-if="isInitedList">
<Lists :list-id="listId" @show-menu="$refs.musicList.hideMenu()" ref="lists" />
<MyLists :list-id="listId" @show-menu="$refs.musicList.hideMenu()" ref="lists" />
<MusicList :list-id="listId" @show-menu="$refs.lists.hideListsMenu()" ref="musicList" />
</div>
@@ -11,13 +11,13 @@ import { getListPrevSelectId } from '@renderer/utils/data'
import { isInitedList } from '@renderer/core/share/list'
import { getList } from '@renderer/core/share/utils'
import Lists from './components/Lists'
import MyLists from './components/MyLists'
import MusicList from './components/MusicList'
export default {
name: 'List',
components: {
Lists,
MyLists,
MusicList,
},
setup() {
@@ -48,7 +48,7 @@ import { computed } from '@renderer/utils/vueTools'
import { getList } from '@renderer/core/share/utils'
export default {
name: 'ListLists',
name: 'MyLists',
props: {
listId: {
type: [String, Number],
+42 -43
View File
@@ -1,5 +1,4 @@
<template>
<div :class="$style.main">
<!-- <div class="scroll" :class="$style.toc">
<ul :class="$style.tocList">
@@ -19,20 +18,20 @@
</div> -->
<div class="scroll" :class="$style.setting" ref="dom_setting">
<dl ref="dom_setting_list">
<Basic />
<Play />
<DesktopLyric />
<Search />
<List />
<Download />
<Sync />
<HotKey />
<Network />
<Odc />
<Backup />
<Other />
<Update />
<About />
<SettingBasic />
<SettingPlay />
<SettingDesktopLyric />
<SettingSearch />
<SettingList />
<SettingDownload />
<SettingSync />
<SettingHotKey />
<SettingNetwork />
<SettingOdc />
<SettingBackup />
<SettingOther />
<SettingUpdate />
<SettingAbout />
</dl>
</div>
</div>
@@ -42,38 +41,38 @@
import { useRefGetter, watch, useCommit } from '@renderer/utils/vueTools'
import { currentStting } from './setting'
import Basic from './components/Basic'
import Play from './components/Play'
import DesktopLyric from './components/DesktopLyric'
import Search from './components/Search'
import List from './components/List'
import Download from './components/Download'
import Sync from './components/Sync'
import HotKey from './components/HotKey'
import Network from './components/Network'
import Odc from './components/Odc'
import Backup from './components/Backup'
import Other from './components/Other'
import Update from './components/Update'
import About from './components/About'
import SettingBasic from './components/SettingBasic'
import SettingPlay from './components/SettingPlay'
import SettingDesktopLyric from './components/SettingDesktopLyric'
import SettingSearch from './components/SettingSearch'
import SettingList from './components/SettingList'
import SettingDownload from './components/SettingDownload'
import SettingSync from './components/SettingSync'
import SettingHotKey from './components/SettingHotKey'
import SettingNetwork from './components/SettingNetwork'
import SettingOdc from './components/SettingOdc'
import SettingBackup from './components/SettingBackup'
import SettingOther from './components/SettingOther'
import SettingUpdate from './components/SettingUpdate'
import SettingAbout from './components/SettingAbout'
export default {
name: 'Setting',
components: {
Basic,
Play,
DesktopLyric,
Search,
List,
Download,
Sync,
HotKey,
Network,
Odc,
Backup,
Other,
Update,
About,
SettingBasic,
SettingPlay,
SettingDesktopLyric,
SettingSearch,
SettingList,
SettingDownload,
SettingSync,
SettingHotKey,
SettingNetwork,
SettingOdc,
SettingBackup,
SettingOther,
SettingUpdate,
SettingAbout,
},
setup() {
const setting = useRefGetter('setting')
@@ -59,7 +59,7 @@ import { openUrl, clipboardWriteText } from '@renderer/utils'
import { currentStting } from '../setting'
export default {
name: 'About',
name: 'SettingAbout',
setup() {
const handleShowPact = () => {
isShowPact.value = true
@@ -31,7 +31,7 @@ import { currentStting } from '../setting'
import { getList } from '@renderer/core/share/utils'
export default {
name: 'Update',
name: 'SettingUpdate',
setup() {
const { t } = useI18n()
const setting = useGetter('setting')
@@ -63,7 +63,7 @@ import apiSourceInfo from '@renderer/utils/music/api-source-info'
import UserApiModal from './UserApiModal'
export default {
name: 'Basic',
name: 'SettingBasic',
components: {
UserApiModal,
},
@@ -21,7 +21,7 @@ import { getSystemFonts } from '@renderer/utils/tools'
import { currentStting } from '../setting'
export default {
name: 'DesktopLyric',
name: 'SettingDesktopLyric',
setup() {
const { t } = useI18n()
const systemFontList = ref([])
@@ -44,7 +44,7 @@ import { openDirInExplorer, selectDir } from '@renderer/utils'
import { currentStting } from '../setting'
export default {
name: 'Download',
name: 'SettingDownload',
setup() {
const { t } = useI18n()
@@ -51,7 +51,7 @@ const formatHotKeyName = (name) => {
}
export default {
name: 'HotKey',
name: 'SettingHotKey',
setup() {
const { t } = useI18n()
const current_hot_key = ref({
@@ -20,7 +20,7 @@ dd(:tips="$t('setting__basic_sourcename_title')")
import { currentStting } from '../setting'
export default {
name: 'List',
name: 'SettingList',
setup() {
return {
currentStting,
@@ -22,7 +22,7 @@ import { debounce } from '@renderer/utils'
import { currentStting } from '../setting'
export default {
name: 'Network',
name: 'SettingNetwork',
setup() {
watch(() => currentStting.value.network.proxy.enable, enable => {
proxy.enable = enable
@@ -12,7 +12,7 @@ dd
import { currentStting } from '../setting'
export default {
name: 'Odc',
name: 'SettingOdc',
setup() {
return {
currentStting,
@@ -26,7 +26,7 @@ import { sizeFormate, clearCache, getCacheSize } from '@renderer/utils'
import { currentStting } from '../setting'
export default {
name: 'Other',
name: 'SettingOther',
setup() {
const { t } = useI18n()
@@ -26,7 +26,7 @@ import { setTaskBarProgress } from '@renderer/utils/tools'
import { currentStting } from '../setting'
export default {
name: 'Play',
name: 'SettingPlay',
setup() {
const mediaDevices = ref([])
const getMediaDevice = async() => {
@@ -15,7 +15,7 @@ dd
import { currentStting } from '../setting'
export default {
name: 'Search',
name: 'SettingSearch',
setup() {
return {
currentStting,
@@ -23,7 +23,7 @@ import { debounce } from '@renderer/utils'
import { currentStting } from '../setting'
export default {
name: 'Update',
name: 'SettingSync',
setup() {
const { t } = useI18n()
@@ -22,7 +22,7 @@ import { sizeFormate } from '@renderer/utils/tools'
import { currentStting } from '../setting'
export default {
name: 'Update',
name: 'SettingUpdate',
setup() {
const { t } = useI18n()
+1 -1
View File
@@ -169,7 +169,7 @@ export default {
if (!this.isVisibleListDetail) this.setTagListWidth()
this.listenEvent()
},
beforeDestroy() {
beforeUnmount() {
this.unlistenEvent()
},
methods: {
@@ -28,16 +28,17 @@ export default {
},
modelValue: {
type: Object,
required: true,
},
},
computed: {
...mapGetters(['setting']),
},
data() {
return {
show: false,
}
},
computed: {
...mapGetters(['setting']),
},
mounted() {
document.addEventListener('click', this.handleHide)
},