File tree Expand file tree Collapse file tree 2 files changed +54
-9
lines changed
src/components/left-panel Expand file tree Collapse file tree 2 files changed +54
-9
lines changed Original file line number Diff line number Diff line change 1
- <script setup lang="ts"></script >
1
+ <script setup lang="ts">
2
+ import VideoList from ' ./VideoList.vue'
3
+ import { typeList } from ' ./typeList'
4
+ import { ref } from ' vue'
5
+
6
+ const activeType = ref (1 )
7
+ const setActiveType = (id : number ) => {
8
+ activeType .value = id
9
+ }
10
+ </script >
2
11
<template >
3
12
<div class =" left-box min-w-[400px] flex bg-[#272836]" >
4
- <div class =" w-[60px] bg-[#1c1c26] flex flex-col gap-2 items-center" >
13
+ <div class =" w-[60px] bg-[#1c1c26] flex flex-col items-center" >
5
14
<div
6
- v-for =" item in 7"
7
- :key =" item"
8
- class =" w-[50px] h-[50px] rounded-lg bg-[#17171e] text-[#ababc0] hover:text-[white] select-none flex flex-col items-center leading-[50px]"
15
+ v-for =" (item, index) in typeList"
16
+ @click =" setActiveType(item.id)"
17
+ :key =" index"
18
+ class =" h-[60px] text-sm w-[60px] hover:bg-[#272836] text-[#ababc0] hover:text-[white] select-none flex flex-col justify-center items-center cursor-pointer"
19
+ :class =" { 'bg-[#272836] text-[white]': activeType === item.id }"
9
20
>
10
- type {{ item }}
21
+ <component :is =" item.icon" />
22
+ {{ item.name }}
11
23
</div >
12
24
</div >
13
- <div class =" text-white p-8 " >
14
- left-panel
15
- <span >( 开发中... )</ span >
25
+ <div class =" text-white p-4 flex-1 " >
26
+ 视频素材:(开发中)
27
+ <VideoList / >
16
28
</div >
17
29
</div >
18
30
</template >
Original file line number Diff line number Diff line change
1
+ import { IconVideo , IconText , IconMusic } from '~/assets/icons/index'
2
+
3
+ export const typeList = [
4
+ {
5
+ id : 1 ,
6
+ name : '视频' ,
7
+ icon : IconVideo
8
+ } ,
9
+ {
10
+ id : 2 ,
11
+ name : '音频' ,
12
+ icon : IconMusic
13
+ } ,
14
+ {
15
+ id : 3 ,
16
+ name : '文字' ,
17
+ icon : IconText
18
+ } ,
19
+ {
20
+ id : 4 ,
21
+ name : '图片' ,
22
+ icon : IconVideo
23
+ } ,
24
+ {
25
+ id : 5 ,
26
+ name : 'SVG' ,
27
+ icon : IconVideo
28
+ } ,
29
+ {
30
+ id : 6 ,
31
+ name : 'GIF'
32
+ }
33
+ ]
You can’t perform that action at this time.
0 commit comments