-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
allen
committed
Oct 23, 2024
1 parent
33f327d
commit 642ebf2
Showing
22 changed files
with
348 additions
and
300 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts" setup> | ||
const { tabs } = useStore('app') | ||
const router = useRouter() | ||
const routes = router.getRoutes() | ||
const needCacheRouteNames = routes | ||
.filter((item) => item.meta && !item.meta.notCache) | ||
.map((item) => item.name) | ||
const cacheList = computed(() => { | ||
const arr = tabs.value | ||
.map((item) => item.name) | ||
.filter((item) => needCacheRouteNames.includes(item)) | ||
return arr | ||
}) | ||
</script> | ||
|
||
<template> | ||
<el-container> | ||
<el-aside> | ||
<Aside /> | ||
</el-aside> | ||
<el-container> | ||
<el-header> | ||
<Header /> | ||
</el-header> | ||
<el-main> | ||
<router-view v-slot="{ Component, route }"> | ||
<transition name="fade-transform" mode="out-in"> | ||
<keep-alive :include="cacheList"> | ||
<component :is="Component" :key="route.name" /> | ||
</keep-alive> | ||
</transition> | ||
</router-view> | ||
</el-main> | ||
</el-container> | ||
</el-container> | ||
<el-backtop target=".el-main" /> | ||
</template> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,59 @@ | ||
<route lang="json"> | ||
{ | ||
"meta": { | ||
"title": "dashboard", | ||
"icon": "clarity:dashboard-solid", | ||
"sort": 1 | ||
} | ||
} | ||
</route> | ||
|
||
<script lang="ts" setup> | ||
const { tabs } = useStore('app') | ||
import apiTest from '@/api/apiTest' | ||
const router = useRouter() | ||
const routes = router.getRoutes() | ||
const needCacheRouteNames = routes | ||
.filter((item) => item.meta && !item.meta.notCache) | ||
.map((item) => item.name) | ||
const cacheList = computed(() => { | ||
const arr = tabs.value | ||
.map((item) => item.name) | ||
.filter((item) => needCacheRouteNames.includes(item)) | ||
return arr | ||
}) | ||
function pushRouter(path: string) { | ||
router.push(path) | ||
} | ||
const { name, fullName, updateName } = useStore('test') | ||
const { userInfo, setUserInfo } = useStore('user') | ||
const dateVal = ref(new Date()) | ||
const icons = ['foundation-indent-more', 'foundation-indent-less'] | ||
async function getTest() { | ||
const res = await apiTest.getTest({ a: 1, isLoading: true }) | ||
if (!res) return | ||
console.log(res, 111) | ||
// res.data.age | ||
// res.data.name | ||
} | ||
async function postTest() { | ||
const res = await apiTest.postTest({ a: 2 }) | ||
if (!res) return | ||
// res.data.val | ||
} | ||
</script> | ||
|
||
<template> | ||
<el-container> | ||
<el-aside> | ||
<Aside /> | ||
</el-aside> | ||
<el-container> | ||
<el-header> | ||
<Header /> | ||
</el-header> | ||
<el-main> | ||
<router-view v-slot="{ Component, route }"> | ||
<transition name="fade-transform" mode="out-in"> | ||
<keep-alive :include="cacheList"> | ||
<component :is="Component" :key="route.name" /> | ||
</keep-alive> | ||
</transition> | ||
</router-view> | ||
</el-main> | ||
</el-container> | ||
</el-container> | ||
<el-backtop target=".el-main" /> | ||
<div class="page-index"> | ||
<div>控制台</div> | ||
<div @click="pushRouter('test1_1')">test1_1</div> | ||
<div @click="pushRouter('test2')">test2</div> | ||
<div>name:{{ name }}</div> | ||
<div>fullName:{{ fullName }}</div> | ||
<div @click="updateName('333')">updateName</div> | ||
<el-button class="br-10 m-10 w-200 c-#387"> I am ElButton </el-button> | ||
<el-date-picker v-model="dateVal" type="date" placeholder="Pick a day" /> | ||
<div v-for="icon in icons" :key="icon" :class="icon" /> | ||
<div @click="getTest">getTest</div> | ||
<div @click="postTest">postTest</div> | ||
<div @click="setUserInfo({ name: 'allen', token: String(Math.random()) })">setUserInfo</div> | ||
<div>userInfo:{{ JSON.stringify(userInfo) }}</div> | ||
<div v-for="i in 50" :key="i">test</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable */ | ||
/* prettier-ignore */ | ||
// @ts-nocheck | ||
// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️ | ||
// It's recommended to commit this file. | ||
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry. | ||
|
||
declare module 'vue-router/auto-routes' { | ||
import type { | ||
RouteRecordInfo, | ||
ParamValue, | ||
ParamValueOneOrMore, | ||
ParamValueZeroOrMore, | ||
ParamValueZeroOrOne, | ||
} from 'vue-router' | ||
|
||
/** | ||
* Route name map generated by unplugin-vue-router | ||
*/ | ||
export interface RouteNamedMap { | ||
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>, | ||
'/[...path]': RouteRecordInfo<'/[...path]', '/:path(.*)', { path: ParamValue<true> }, { path: ParamValue<false> }>, | ||
'/login': RouteRecordInfo<'/login', '/login', Record<never, never>, Record<never, never>>, | ||
'/test1': RouteRecordInfo<'/test1', '/test1', Record<never, never>, Record<never, never>>, | ||
'/test1/test1_1': RouteRecordInfo<'/test1/test1_1', '/test1/test1_1', Record<never, never>, Record<never, never>>, | ||
'/test1/test1_1/test1_1_1': RouteRecordInfo<'/test1/test1_1/test1_1_1', '/test1/test1_1/test1_1_1', Record<never, never>, Record<never, never>>, | ||
'/test1/test1_2': RouteRecordInfo<'/test1/test1_2', '/test1/test1_2', Record<never, never>, Record<never, never>>, | ||
'/test1/test1_3': RouteRecordInfo<'/test1/test1_3', '/test1/test1_3', Record<never, never>, Record<never, never>>, | ||
'/test2': RouteRecordInfo<'/test2', '/test2', Record<never, never>, Record<never, never>>, | ||
'/test3': RouteRecordInfo<'/test3', '/test3', Record<never, never>, Record<never, never>>, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.