style(app): 使用 NuxtImg 替代 img 标签

在多个组件中将 `img` 标签替换为 `NuxtImg` 标签,提升图片加载的性能和优化。例如,在 `AboutSection.vue`、`FriendsSection.vue`、`HeroSection.vue`、`ProjectsSection.vue`、`SitesSection.vue` 和 `SkillsSection.vue` 中的图片标签。

refactor(app): 扩展 `nuxt.config.ts` 配置

扩展了 `nuxt.config.ts` 配置文件中的模块配置,添加了 `@nuxt/image` 和 `@nuxt/eslint` 模块。同时,优化了 `routeRules` 配置,以支持预渲染和增量静态生成。
This commit is contained in:
2025-12-18 22:13:47 +08:00
parent bda4281fde
commit 6b05f7c74e
21 changed files with 423 additions and 231 deletions

View File

@@ -1,6 +1,15 @@
import { defineNuxtPlugin } from "#app";
import siteConfig from "~/config/siteConfig";
type NeteaseMiniPlayerGlobal = {
init?: () => void;
};
type NeteaseWindow = Window & {
NeteaseMiniPlayer?: NeteaseMiniPlayerGlobal;
__NETEASE_MUSIC_CONFIG__?: unknown;
};
export default defineNuxtPlugin(() => {
if (import.meta.server) return;
@@ -35,7 +44,7 @@ export default defineNuxtPlugin(() => {
const ensureScript = () =>
new Promise<void>((resolve) => {
// 检查全局对象是否已存在,表示脚本已加载
const anyWin = window as any;
const anyWin = window as NeteaseWindow;
if (anyWin.NeteaseMiniPlayer) {
resolve();
return;
@@ -62,7 +71,7 @@ export default defineNuxtPlugin(() => {
});
const initPlayer = () => {
const anyWin = window as any;
const anyWin = window as NeteaseWindow;
// 将 siteConfig 的音乐配置传递给全局 window 对象
if (!anyWin.__NETEASE_MUSIC_CONFIG__) {