|
@@ -1,4 +1,4 @@
|
|
-import { defineComponent } from 'vue';
|
|
|
|
|
|
+import { defineComponent, reactive } from 'vue';
|
|
import { NImage } from 'naive-ui';
|
|
import { NImage } from 'naive-ui';
|
|
import styles from './index.module.less';
|
|
import styles from './index.module.less';
|
|
import logo from './images/logo.png';
|
|
import logo from './images/logo.png';
|
|
@@ -20,59 +20,80 @@ import SilderItem from './modals/silderItem';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'layoutSilder',
|
|
name: 'layoutSilder',
|
|
setup() {
|
|
setup() {
|
|
- const itemInfoList = [
|
|
|
|
|
|
+ const itemInfoList = reactive([
|
|
{
|
|
{
|
|
activeIcon: indexIcon,
|
|
activeIcon: indexIcon,
|
|
name: '主页',
|
|
name: '主页',
|
|
normalIcon: indexNormal,
|
|
normalIcon: indexNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: true,
|
|
|
|
+ id: 1
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: studentIcon,
|
|
activeIcon: studentIcon,
|
|
name: '学生',
|
|
name: '学生',
|
|
normalIcon: studentNormal,
|
|
normalIcon: studentNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 2
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: classIcon,
|
|
activeIcon: classIcon,
|
|
name: '班级',
|
|
name: '班级',
|
|
normalIcon: classNormal,
|
|
normalIcon: classNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 3
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: palyIcon,
|
|
activeIcon: palyIcon,
|
|
name: '备课',
|
|
name: '备课',
|
|
normalIcon: palyNormal,
|
|
normalIcon: palyNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 4
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: kuIcon,
|
|
activeIcon: kuIcon,
|
|
name: '小酷AI',
|
|
name: '小酷AI',
|
|
normalIcon: kuNormal,
|
|
normalIcon: kuNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 5
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: resourceIcon,
|
|
activeIcon: resourceIcon,
|
|
name: '资源',
|
|
name: '资源',
|
|
normalIcon: resourceNormal,
|
|
normalIcon: resourceNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 6
|
|
},
|
|
},
|
|
{
|
|
{
|
|
activeIcon: setIcon,
|
|
activeIcon: setIcon,
|
|
name: '设置',
|
|
name: '设置',
|
|
normalIcon: setNormal,
|
|
normalIcon: setNormal,
|
|
- isActive: false
|
|
|
|
|
|
+ isActive: false,
|
|
|
|
+ id: 7
|
|
}
|
|
}
|
|
- ];
|
|
|
|
|
|
+ ]);
|
|
|
|
+ const checkNavBar = (item: any) => {
|
|
|
|
+ console.log('checkNavBar', item);
|
|
|
|
+ itemInfoList.forEach((now: any) => {
|
|
|
|
+ now.isActive = false;
|
|
|
|
+ });
|
|
|
|
+ itemInfoList.forEach((now: any) => {
|
|
|
|
+ if (now.id == item.id) {
|
|
|
|
+ now.isActive = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ console.log('checkNavBar', item);
|
|
|
|
+ };
|
|
return () => (
|
|
return () => (
|
|
<>
|
|
<>
|
|
<div class={styles.silder}>
|
|
<div class={styles.silder}>
|
|
<div class={styles.logoWrap}>
|
|
<div class={styles.logoWrap}>
|
|
- <NImage width="62" height="60" src={logo} preview-disabled></NImage>
|
|
|
|
|
|
+ <NImage class={styles.logo} src={logo} preview-disabled></NImage>
|
|
</div>
|
|
</div>
|
|
<div class={styles.sliderList}>
|
|
<div class={styles.sliderList}>
|
|
{itemInfoList.map((item: any) => (
|
|
{itemInfoList.map((item: any) => (
|
|
- <SilderItem item={item}> </SilderItem>
|
|
|
|
|
|
+ <SilderItem onCheckNavBar={checkNavBar} item={item}>
|
|
|
|
+ {' '}
|
|
|
|
+ </SilderItem>
|
|
))}
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|