-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加路由示例 首页loading 更新docs
- Loading branch information
Showing
15 changed files
with
121 additions
and
382 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ node_modules | |
dist | ||
public | ||
.husky | ||
index.html |
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 |
---|---|---|
@@ -1,30 +1,18 @@ | ||
<template> | ||
<div class="py-100px"> | ||
<img src="/logo.svg" class="logo w-150px" alt="Vite logo" /> | ||
<n-h2>一款简洁,符合通用标准的,基于Vite构建的Vue3项目模板</n-h2> | ||
<div> | ||
<n-text>下面是操作useCounterStore进行计数,并实现持久化的例子</n-text> | ||
<n-p> | ||
<n-button type="primary" @click="counter.increment">点我加1</n-button> | ||
<n-text class="px-20px text-20px">{{ count }}</n-text> | ||
</n-p> | ||
</div> | ||
<div class="pt-20px"> | ||
<n-text>下面是通过SVG名称,动态加载本地和iconify线上SVG的例子</n-text> | ||
<n-p class="flex-row-center h-30px gap-10px"> | ||
<n-text>本地Svg</n-text> | ||
<SvgIcon localIcon="logo" class="w-24px h-24px"></SvgIcon> | ||
</n-p> | ||
<n-p class="flex-row-center h-30px gap-5px"> | ||
<n-text>Iconify</n-text> | ||
<SvgIcon icon="fluent-mdl2:react-logo" class="w-24px h-24px"></SvgIcon> | ||
<SvgIcon :icon="'fluent-mdl2:react-logo'" class="w-24px h-24px text-red"></SvgIcon> | ||
</n-p> | ||
</div> | ||
</div> | ||
<NConfigProvider :locale="zhCN" :date-locale="dateZhCN" preflight-style-disabled> | ||
<n-loading-bar-provider> | ||
<n-dialog-provider> | ||
<n-notification-provider> | ||
<n-message-provider> | ||
<RouterView></RouterView> | ||
</n-message-provider> | ||
</n-notification-provider> | ||
</n-dialog-provider> | ||
</n-loading-bar-provider> | ||
<NGlobalStyle /> | ||
</NConfigProvider> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import SvgIcon from './components/SvgIcon.vue' | ||
const counter = useCounterStore() | ||
const { count } = storeToRefs(counter) | ||
import { zhCN, dateZhCN } from 'naive-ui' | ||
</script> |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div class="flex-row-center flex-col"> | ||
<SvgIcon localIcon="logo" class="w-128px h-128px"></SvgIcon> | ||
<div class="w-56px h-56px my-36px"> | ||
<div class="relative h-full animate-spin"> | ||
<div v-for="(item, index) in lodingClasses" :key="index" class="absolute w-16px h-16px bg-primary rounded-8px animate-pulse" :class="item"></div> | ||
</div> | ||
</div> | ||
<h2 class="text-28px font-500 text-#646464">{{ VITE_SYSTEM_LOADING }}</h2> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts" name="AppLoading"> | ||
const { VITE_SYSTEM_LOADING } = import.meta.env | ||
const lodingClasses = ['left-0 top-0', 'left-0 bottom-0 animate-delay-500', 'right-0 top-0 animate-delay-1000', 'right-0 bottom-0 animate-delay-1500'] | ||
const primaryCss = useCssVar('--primary-color') | ||
primaryCss.value = '52,199,89' | ||
</script> |
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,8 @@ | ||
import { type RouteRecordRaw } from 'vue-router' | ||
|
||
const routes: RouteRecordRaw = { | ||
name: 'index', | ||
path: '/', | ||
component: async () => await import('../../views/index.vue') | ||
} | ||
export default routes |
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,11 @@ | ||
const modules = import.meta.glob('./**/*.ts', { eager: true }) as any | ||
const route: any[] = [] | ||
Object.keys(modules).forEach((key) => { | ||
const item = modules[key].default | ||
if (item) { | ||
route.push(item) | ||
} else { | ||
window.console.error(`路由模块解析出错: key = ${key}`) | ||
} | ||
}) | ||
export const routes = route |
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.
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,29 @@ | ||
<template> | ||
<div> | ||
<img src="/logo.svg" class="logo w-150px" alt="Vite logo" /> | ||
<n-h2>一款简洁,符合通用标准的,基于Vite构建的Vue3项目模板</n-h2> | ||
<div> | ||
<n-text>下面是操作useCounterStore进行计数,并实现持久化的例子</n-text> | ||
<n-p> | ||
<n-button type="primary" @click="counter.increment">点我加1</n-button> | ||
<n-text class="px-20px text-20px">{{ count }}</n-text> | ||
</n-p> | ||
</div> | ||
<div class="pt-20px"> | ||
<n-text>下面是通过SVG名称,动态加载本地和iconify线上SVG的例子</n-text> | ||
<n-p class="flex-row-center h-30px gap-10px"> | ||
<n-text>本地Svg</n-text> | ||
<SvgIcon localIcon="logo" class="w-24px h-24px"></SvgIcon> | ||
</n-p> | ||
<n-p class="flex-row-center h-30px gap-5px"> | ||
<n-text>Iconify</n-text> | ||
<SvgIcon icon="fluent-mdl2:react-logo" class="w-24px h-24px"></SvgIcon> | ||
<SvgIcon :icon="'fluent-mdl2:react-logo'" class="w-24px h-24px text-red"></SvgIcon> | ||
</n-p> | ||
</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
const counter = useCounterStore() | ||
const { count } = storeToRefs(counter) | ||
</script> |