index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <script setup lang="ts">
  2. // @ts-ignore
  3. import { codeToHtml } from 'https://cdn.jsdelivr.net/npm/shiki@3.7.0/+esm'
  4. import { NCard, NSplit, NButton, NScrollbar, NTag } from 'naive-ui'
  5. import { ref, watch } from 'vue'
  6. import packageJson from '@/../package.json'
  7. import { usePersonalization } from '@/composable/usePersonalization'
  8. const APP_NAME = import.meta.env.VITE_APP_NAME
  9. const { isDark } = usePersonalization()
  10. const { dependencies, devDependencies } = packageJson
  11. const directoryStructure = ref(``)
  12. const dependenciesCodeHighlight = ref('')
  13. const devDependenciesCodeHighlight = ref('')
  14. const dir = `📂 lithe-admin
  15. ├── 📄 .editorconfig
  16. ├── 📄 .env.development
  17. ├── 📄 .env.production
  18. ├── 📄 .gitattributes
  19. ├── 📄 .gitignore
  20. ├── 📄 .prettierrc.json
  21. ├── 📄 README.md
  22. ├── 📄 eslint.config.ts
  23. ├── 📄 index.html
  24. ├── 📄 package.json
  25. ├── 📄 pnpm-lock.yaml
  26. └── 📂 public/
  27. │ └── 📂 assets/
  28. │ ├── 📄 preloader.css
  29. │ ├── 📄 favicon.ico
  30. └── 📂 src/
  31. │ ├── 📄 App.vue
  32. │ └── 📂 assets/
  33. │ ├── 📄 base.css
  34. │ ├── 📄 main.css
  35. │ ├── 📄 noise.png
  36. │ ├── 📄 texture.png
  37. │ ├── 📄 topography.svg
  38. │ └── 📂 components/
  39. │ ├── 📄 Avatar.vue
  40. │ ├── 📄 ButtonAnimation.vue
  41. │ ├── 📄 HintHelp.vue
  42. │ ├── 📄 Noise.vue
  43. │ ├── 📄 EmptyPlaceholder.vue
  44. │ └── 📂 __tests__/
  45. │ ├── 📄 comp.test.ts
  46. │ ├── 📄 index.ts
  47. │ └── 📂 composable/
  48. │ └── 📂 comp/
  49. │ ├── 📄 useComponentModifier.ts
  50. │ ├── 📄 useComponentThemeOverrides.ts
  51. │ ├── 📄 useDataTable.ts
  52. │ ├── 📄 useDiscreteApi.ts
  53. │ ├── 📄 usePersonalization.ts
  54. │ ├── 📄 useResettable.ts
  55. │ ├── 📄 useTheme.ts
  56. │ └── 📂 injection/
  57. │ ├── 📄 index.ts
  58. │ ├── 📄 interface.ts
  59. │ └── 📂 layout/
  60. │ └── 📂 aside/
  61. │ └── 📂 component/
  62. │ ├── 📄 Menu.vue
  63. │ ├── 📄 UserCard.vue
  64. │ ├── 📄 index.vue
  65. │ └── 📂 component/
  66. │ ├── 📄 Tabs.vue
  67. │ └── 📂 footer/
  68. │ ├── 📄 index.vue
  69. │ └── 📂 header/
  70. │ └── 📂 Actions/
  71. │ └── 📂 component/
  72. │ ├── 📄 ConfigureDrawer.vue
  73. │ ├── 📄 FullScreen.vue
  74. │ ├── 📄 NoiseModal.vue
  75. │ ├── 📄 SignOut.vue
  76. │ ├── 📄 ThemeDropdown.vue
  77. │ ├── 📄 WatermarkModal.vue
  78. │ ├── 📄 index.vue
  79. │ ├── 📄 Breadcrumb.vue
  80. │ ├── 📄 Logo.vue
  81. │ ├── 📄 Navigation.vue
  82. │ ├── 📄 index.vue
  83. │ ├── 📄 index.vue
  84. │ └── 📂 main/
  85. │ ├── 📄 index.vue
  86. │ ├── 📄 main.ts
  87. │ └── 📂 router/
  88. │ ├── 📄 guard.ts
  89. │ ├── 📄 helper.ts
  90. │ ├── 📄 index.ts
  91. │ ├── 📄 record.ts
  92. │ └── 📂 stores/
  93. │ ├── 📄 configure.ts
  94. │ ├── 📄 tabs.ts
  95. │ ├── 📄 user.ts
  96. │ └── 📂 theme/
  97. │ ├── 📄 common.ts
  98. │ ├── 📄 dark.ts
  99. │ ├── 📄 light.ts
  100. │ └── 📂 typings/
  101. │ ├── 📄 env.d.ts
  102. │ ├── 📄 vue-router.d.ts
  103. │ ├── 📄 window.d.ts
  104. │ └── 📂 utils/
  105. │ ├── 📄 tailwindColor.test.ts
  106. │ ├── 📄 tailwindColor.ts
  107. │ └── 📂 views/
  108. │ └── 📂 about/
  109. │ ├── 📄 index.vue
  110. │ └── 📂 dashboard/
  111. │ ├── 📄 index.vue
  112. │ └── 📂 data-show/
  113. │ └── 📂 data-form/
  114. │ ├── 📄 index.vue
  115. │ └── 📂 data-table/
  116. │ ├── 📄 ModalData.vue
  117. │ ├── 📄 index.vue
  118. │ └── 📂 draggable/
  119. │ ├── 📄 index.vue
  120. │ └── 📂 feedback/
  121. │ ├── 📄 discreteApi.ts
  122. │ ├── 📄 index.vue
  123. │ └── 📂 multi-level-menu/
  124. │ ├── 📄 index.vue
  125. │ └── 📂 not-found/
  126. │ ├── 📄 404.vue
  127. │ ├── 📄 index.vue
  128. │ └── 📂 sign-in/
  129. │ └── 📂 component/
  130. │ ├── 📄 Illustration1.vue
  131. │ ├── 📄 Illustration2.vue
  132. │ ├── 📄 Illustration3.vue
  133. │ ├── 📄 Illustration4.vue
  134. │ ├── 📄 ThemeColorPopover.vue
  135. │ ├── 📄 index.vue
  136. ├── 📄 tailwind.config.ts
  137. ├── 📄 tsconfig.app.json
  138. ├── 📄 tsconfig.json
  139. ├── 📄 tsconfig.node.json
  140. ├── 📄 tsconfig.vitest.json
  141. ├── 📄 vite.config.ts
  142. └── 📄 vitest.config.ts`
  143. watch(
  144. isDark,
  145. async (isDark) => {
  146. directoryStructure.value = await codeToHtml(dir, {
  147. lang: 'markdown',
  148. theme: isDark ? 'dark-plus' : 'min-light',
  149. })
  150. dependenciesCodeHighlight.value = await codeToHtml(JSON.stringify(dependencies, null, 2), {
  151. lang: 'json',
  152. theme: isDark ? 'dark-plus' : 'min-light',
  153. })
  154. devDependenciesCodeHighlight.value = await codeToHtml(
  155. JSON.stringify(devDependencies, null, 2),
  156. {
  157. lang: 'json',
  158. theme: isDark ? 'dark-plus' : 'min-light',
  159. },
  160. )
  161. },
  162. {
  163. immediate: true,
  164. },
  165. )
  166. </script>
  167. <template>
  168. <div class="flex flex-col gap-y-4 p-4">
  169. <NCard :title="`关于 ${APP_NAME}`">
  170. <p class="text-base">
  171. {{ APP_NAME }} 是一个基于
  172. <a
  173. href="https://vuejs.org/"
  174. target="_blank"
  175. >
  176. <NButton
  177. strong
  178. secondary
  179. size="small"
  180. color="#42b883"
  181. >
  182. Vue3
  183. </NButton>
  184. </a>
  185. <a
  186. href="https://www.naiveui.com/"
  187. target="_blank"
  188. >
  189. <NButton
  190. strong
  191. secondary
  192. color="#75B93F"
  193. size="small"
  194. style="margin-left: 4px"
  195. >
  196. Naive UI
  197. </NButton>
  198. </a>
  199. <a
  200. href="https://vitejs.dev/"
  201. target="_blank"
  202. >
  203. <NButton
  204. strong
  205. secondary
  206. color="#9499ff"
  207. size="small"
  208. style="margin-left: 4px"
  209. >
  210. Vite7
  211. </NButton>
  212. </a>
  213. <a
  214. href="https://tailwindcss.com/"
  215. target="_blank"
  216. >
  217. <NButton
  218. strong
  219. secondary
  220. color="#00bcff"
  221. size="small"
  222. class="ml-1!"
  223. >
  224. TailwindCSS4
  225. </NButton>
  226. </a>
  227. <NButton
  228. strong
  229. secondary
  230. size="small"
  231. >
  232. TypeScript
  233. </NButton>
  234. 构建的极简而优雅的后台管理模板,主题配色基于 TailwindCSS 的色彩体系设计。
  235. </p>
  236. </NCard>
  237. <div class="flex gap-x-2">
  238. <NCard title="目录结构">
  239. <NScrollbar container-style="max-height: 1100px;">
  240. <div v-html="directoryStructure"></div>
  241. </NScrollbar>
  242. </NCard>
  243. <NCard title="依赖信息">
  244. <NSplit
  245. direction="vertical"
  246. pane1-class="pb-4"
  247. pane2-class="pt-4"
  248. default-size="2"
  249. >
  250. <template #1>
  251. <NTag
  252. class="mb-4"
  253. :bordered="false"
  254. type="info"
  255. size="small"
  256. >dependencies</NTag
  257. >
  258. <NScrollbar>
  259. <div v-html="dependenciesCodeHighlight"></div>
  260. </NScrollbar>
  261. </template>
  262. <template #2>
  263. <NTag
  264. class="mb-4"
  265. :bordered="false"
  266. type="info"
  267. size="small"
  268. >devDependencies</NTag
  269. >
  270. <NScrollbar>
  271. <div v-html="devDependenciesCodeHighlight"></div>
  272. </NScrollbar>
  273. </template>
  274. <template #resize-trigger>
  275. <div class="h-px w-full cursor-col-resize bg-neutral-200 dark:bg-neutral-700"></div>
  276. </template>
  277. </NSplit>
  278. </NCard>
  279. </div>
  280. </div>
  281. </template>