mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
v3.0.2发布,新增文档,优化一些结构
This commit is contained in:
parent
4d84d7a553
commit
f76b122a38
@ -7,7 +7,8 @@
|
||||
"Echart": "Chart",
|
||||
"scrollReveal": "Scroll Reveal",
|
||||
"Axios": "Axios Request",
|
||||
"Table": "Table"
|
||||
"Table": "Table",
|
||||
"Doc": "Doc"
|
||||
},
|
||||
"LayoutHeaderTooltipOptions": {
|
||||
"Reload": "Reload Current Page",
|
||||
|
@ -7,7 +7,8 @@
|
||||
"Echart": "可视化",
|
||||
"scrollReveal": "滚动动画",
|
||||
"Axios": "请求",
|
||||
"Table": "表格"
|
||||
"Table": "表格",
|
||||
"Doc": "文档"
|
||||
},
|
||||
"LayoutHeaderTooltipOptions": {
|
||||
"Reload": "刷新当前页面",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ray-template",
|
||||
"private": true,
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
13
src/icons/doc.svg
Normal file
13
src/icons/doc.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<svg t="1672296474975" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="5926" width="64" height="64">
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M832.1 185.1H609.4l-17.1-62c-9.6-34.6-40.5-58.8-75.3-58.8H196c-43.2 0-78.3 36.4-78.3 81.1V897c0 35.3 28.7 64 64 64H832c35.3 0 64-28.7 64-64V249c0.1-35.2-28.6-63.9-63.9-63.9z m-644.4-39.7c0-6.6 4.4-11.1 8.3-11.1h321c3.4 0 6.6 3.1 7.8 7.4l12 43.4H187.7v-39.7z m638.4 745.8H187.7V255.1h638.4v636.1z"
|
||||
p-id="5927"></path>
|
||||
<path fill="currentColor" d="M346.1 415.1m-35 0a35 35 0 1 0 70 0 35 35 0 1 0-70 0Z" p-id="5928"></path>
|
||||
<path fill="currentColor" d="M462.3 380.1h257.8v70H462.3z" p-id="5929"></path>
|
||||
<path fill="currentColor" d="M346.1 582.3m-35 0a35 35 0 1 0 70 0 35 35 0 1 0-70 0Z" p-id="5930"></path>
|
||||
<path fill="currentColor" d="M462.3 547.3h257.8v70H462.3z" p-id="5931"></path>
|
||||
<path fill="currentColor" d="M346.1 749.5m-35 0a35 35 0 1 0 70 0 35 35 0 1 0-70 0Z" p-id="5932"></path>
|
||||
<path fill="currentColor" d="M462.3 714.5h257.8v70H462.3z" p-id="5933"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
10
src/router/modules/doc.ts
Normal file
10
src/router/modules/doc.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export default {
|
||||
path: '/doc',
|
||||
name: 'doc',
|
||||
component: () => import('@/views/doc/index'),
|
||||
meta: {
|
||||
i18nKey: 'Doc',
|
||||
icon: 'doc',
|
||||
windowOpen: 'https://xiaodaigua-ray.github.io/ray-template-doc/',
|
||||
},
|
||||
}
|
@ -5,8 +5,9 @@ import echart from './echart'
|
||||
import scrollReveal from './scroll-reveal'
|
||||
import axios from './axios'
|
||||
import table from './table'
|
||||
import doc from './doc'
|
||||
|
||||
const routes = [dashboard, echart, table, axios, scrollReveal, error, reyl]
|
||||
const routes = [dashboard, echart, table, axios, scrollReveal, error, doc, reyl]
|
||||
|
||||
export default routes
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { NEllipsis } from 'naive-ui'
|
||||
import RayIcon from '@/components/RayIcon/index'
|
||||
|
||||
import type { MenuOption } from 'naive-ui'
|
||||
import type { RouteRecordRaw } from 'vue-router'
|
||||
import type { RouteRecordRaw, RouteMeta } from 'vue-router'
|
||||
|
||||
export const useMenu = defineStore('menu', () => {
|
||||
const router = useRouter()
|
||||
@ -40,12 +40,18 @@ export const useMenu = defineStore('menu', () => {
|
||||
* 修改 `menu key` 后的回调函数
|
||||
*/
|
||||
const menuModelValueChange = (key: string, item: MenuOption) => {
|
||||
handleMenuTagOptions(item as unknown as TagMenuOptions)
|
||||
const meta = item.meta as RouteMeta
|
||||
|
||||
menuState.menuKey = key
|
||||
if (meta.windowOpen) {
|
||||
window.open(meta.windowOpen)
|
||||
} else {
|
||||
handleMenuTagOptions(item as unknown as TagMenuOptions)
|
||||
|
||||
router.push(`${item.path}`)
|
||||
setCache('menuKey', key)
|
||||
menuState.menuKey = key
|
||||
|
||||
router.push(`${item.path}`)
|
||||
setCache('menuKey', key)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
20
src/views/doc/index.tsx
Normal file
20
src/views/doc/index.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
*
|
||||
* @author Ray <https://github.com/XiaoDaiGua-Ray>
|
||||
*
|
||||
* @date 2022-12-29
|
||||
*
|
||||
* @workspace ray-template
|
||||
*
|
||||
* @remark 今天也是元气满满撸代码的一天
|
||||
*/
|
||||
|
||||
const RayTemplateDoc = defineComponent({
|
||||
name: 'RayTemplateDoc',
|
||||
// setup() {},
|
||||
render() {
|
||||
return <div></div>
|
||||
},
|
||||
})
|
||||
|
||||
export default RayTemplateDoc
|
1
src/vite-env.d.ts
vendored
1
src/vite-env.d.ts
vendored
@ -14,6 +14,7 @@ declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
i18nKey: string
|
||||
icon?: string
|
||||
windowOpen?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user