mirror of
https://github.com/RhenCloud/Cloud-Home.git
synced 2026-01-22 17:39:07 +08:00
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:
@@ -2,10 +2,14 @@
|
||||
<section class="card grid grid-cols-[120px_1fr] gap-4 items-center hover:shadow-lg-dark group">
|
||||
<div class="relative">
|
||||
<div
|
||||
class="absolute inset-0 rounded-full bg-gradient-to-br from-primary/30 to-accent/20 blur-xl group-hover:blur-2xl transition-all duration-300 opacity-0 group-hover:opacity-100">
|
||||
</div>
|
||||
<img class="relative w-30 h-30 rounded-full object-cover border-2 border-primary/40 shadow-md-dark bg-white transition-transform duration-300 group-hover:scale-105"
|
||||
:src="profile.avatar" alt="avatar" loading="lazy" />
|
||||
class="absolute inset-0 rounded-full bg-gradient-to-br from-primary/30 to-accent/20 blur-xl group-hover:blur-2xl transition-all duration-300 opacity-0 group-hover:opacity-100"
|
||||
/>
|
||||
<NuxtImg
|
||||
class="relative w-30 h-30 rounded-full object-cover border-2 border-primary/40 shadow-md-dark bg-white transition-transform duration-300 group-hover:scale-105"
|
||||
:src="profile.avatar"
|
||||
alt="avatar"
|
||||
loading="eager"
|
||||
/>
|
||||
</div>
|
||||
<div class="overflow-hidden">
|
||||
<h1 class="text-2xl font-bold">{{ profile.name }}</h1>
|
||||
@@ -16,5 +20,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({ profile: Object });
|
||||
import siteConfig from "../config/siteConfig";
|
||||
|
||||
const { profile } = defineProps({
|
||||
profile: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => siteConfig.profile || {},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user