Skip to content

Commit

Permalink
chore: 调整 icon 引入方式
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrongding committed Apr 10, 2024
1 parent 7f71007 commit 3db4b99
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 15 deletions.
37 changes: 37 additions & 0 deletions src/assets/icons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import IconCopy from '~/assets/icons/control-copy.svg?component'
import IconCut from '~/assets/icons/control-cut.svg?component'
import IconDelete from '~/assets/icons/control-delete.svg?component'
import IconNext from '~/assets/icons/control-next.svg?component'
import IconPause from '~/assets/icons/control-pause.svg?component'
import IconPlay from '~/assets/icons/control-play.svg?component'
import IconPrev from '~/assets/icons/control-prev.svg?component'
import IconRedo from '~/assets/icons/control-redo.svg?component'
import IconUndo from '~/assets/icons/control-undo.svg?component'
import IconZoomin from '~/assets/icons/control-zoomin.svg?component'
import IconZoomout from '~/assets/icons/control-zoomout.svg?component'
import IconZoomToFit from '~/assets/icons/control-zoomtofit.svg?component'
import IconExport from '~/assets/icons/icon-export.svg?component'
import IconGithub from '~/assets/icons/icon-github.svg?component'
import IconMusic from '~/assets/icons/icon-music.svg?component'
import IconText from '~/assets/icons/icon-text.svg?component'
import IconVideo from '~/assets/icons/icon-video.svg?component'

export {
IconExport,
IconGithub,
IconMusic,
IconText,
IconVideo,
IconCopy,
IconCut,
IconDelete,
IconNext,
IconPause,
IconPlay,
IconPrev,
IconRedo,
IconUndo,
IconZoomin,
IconZoomout,
IconZoomToFit
}
26 changes: 14 additions & 12 deletions src/components/bottom-panel/BottomPanel.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<script setup lang="ts">
import TrackList from './TrackList.vue'
import { storeToRefs } from 'pinia'
import IconCopy from '~/assets/icons/control-copy.svg?component'
import IconCut from '~/assets/icons/control-cut.svg?component'
import IconDelete from '~/assets/icons/control-delete.svg?component'
import IconNext from '~/assets/icons/control-next.svg?component'
import IconPause from '~/assets/icons/control-pause.svg?component'
import IconPlay from '~/assets/icons/control-play.svg?component'
import IconPrev from '~/assets/icons/control-prev.svg?component'
import IconRedo from '~/assets/icons/control-redo.svg?component'
import IconUndo from '~/assets/icons/control-undo.svg?component'
import IconZoomin from '~/assets/icons/control-zoomin.svg?component'
import IconZoomout from '~/assets/icons/control-zoomout.svg?component'
import IconZoomToFit from '~/assets/icons/control-zoomtofit.svg?component'
import {
IconCopy,
IconCut,
IconDelete,
IconNext,
IconPause,
IconPlay,
IconPrev,
IconRedo,
IconUndo,
IconZoomToFit,
IconZoomin,
IconZoomout
} from '~/assets/icons/index'
import { usePlayerStore } from '~/stores/player'
import { formatSeconds } from '~/utils/index'
Expand Down
2 changes: 1 addition & 1 deletion src/stores/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const usePlayerStore = defineStore('playerStore', () => {
playStatus.value = state === undefined ? !playStatus.value : state
}
// 播放列表
const playList = ref([])
const playList = ref<string[]>([])
// 轨道数
const trackCount = computed(() => playList.value.length)

Expand Down
3 changes: 1 addition & 2 deletions src/views/main-page.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import IconExport from '~/assets/icons/icon-export.svg?component'
import IconGithub from '~/assets/icons/icon-github.svg?component'
import { IconExport, IconGithub } from '~/assets/icons/index'
import BottomPanel from '~/components/bottom-panel/BottomPanel.vue'
import LeftPanel from '~/components/left-panel/LeftPanel.vue'
import CanvasPlayer from '~/components/player/CanvasPlayer.vue'
Expand Down

0 comments on commit 3db4b99

Please sign in to comment.