feat(teachers): add icons

This commit is contained in:
thehrz 2023-08-18 20:35:56 +08:00
parent 384b35dc59
commit f4635c0502
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
2 changed files with 27 additions and 1 deletions

1
src/components.d.ts vendored
View File

@ -20,6 +20,7 @@ declare module 'vue' {
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
VIcon: typeof import('vuetify/components')['VIcon']
VImg: typeof import('vuetify/components')['VImg']
VList: typeof import('vuetify/components')['VList']
VListItem: typeof import('vuetify/components')['VListItem']

View File

@ -7,6 +7,26 @@ const teachers = _teachers as Teachers
interface Teachers {
[key: string]: Teacher[]
}
const icons = {
语文: 'mdi-ideogram-cjk-variant',
数学: 'mdi-math-integral',
英语: 'mdi-alpha-e-box-outline',
道德与法治: 'mdi-scale-balance',
历史: 'mdi-pillar',
物理: 'mdi-cube-outline',
化学: 'mdi-molecule',
体育: 'mdi-run',
音乐: 'mdi-music',
美术: 'mdi-palette',
信息技术: 'mdi-desktop-classic',
地理: 'mdi-map-marker',
生物: 'mdi-dna',
综合: 'mdi-tooltip',
科学: 'mdi-microscope',
} as {
[key: string]: string
}
</script>
<template>
@ -14,7 +34,12 @@ interface Teachers {
<h1>在19预科2班任教的老师</h1>
<v-list lines="three">
<v-list-item v-for="item in Object.keys(_teachers)" :key="item" :title="item">
<v-list-item v-for="item in Object.keys(_teachers)" :key="item">
<v-list-item-title>
<h2 class="mt-0">
<v-icon :icon="icons[item]" />{{ item }}
</h2>
</v-list-item-title>
<v-expansion-panels multiple>
<v-expansion-panel v-for="teacher in teachers[item]" :key="teacher.name" :title="teacher.name">
<v-expansion-panel-text>