revise css

This commit is contained in:
Kisechan
2025-03-02 22:42:09 +08:00
parent a71376fe05
commit 42cbc98394
6 changed files with 111 additions and 70 deletions

View File

@ -1,10 +1,10 @@
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus' // 引入 Element Plus
import 'element-plus/dist/index.css' // 引入 Element Plus 样式
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
app.use(router)
app.use(router)
app.use(ElementPlus) // 使用 Element Plus
app.mount('#app')

View File

@ -1,8 +1,8 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Home from '@/views/Home.vue' // 确保路径正确
const routes = [
{ path: '/', component: Home }
{ path: '/', component: Home } // 确保根路径指向 Home 组件
]
const router = createRouter({

View File

@ -1,62 +1,62 @@
<template>
<div class="container">
<h1 class="title">Kisechan</h1>
<el-row :gutter="20">
<el-col
v-for="(link, index) in links"
:key="index"
:xs="24" :sm="12" :md="8" :lg="6"
>
<el-card class="link-card">
<template #header>
<div class="card-header">
<el-icon><Link /></el-icon>
<span>{{ link.name }}</span>
</div>
</template>
<el-button
type="primary"
@click="openLink(link.url)"
>
访问网站
</el-button>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script setup>
import { Link } from '@element-plus/icons-vue'
const links = [
{ name: 'GitHub', url: 'https://github.com' },
{ name: '博客', url: 'https://zhihu.com' }
]
const openLink = (url) => {
window.open(url, '_blank')
}
</script>
<style scoped>
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.title {
text-align: center;
color: #303133;
margin-bottom: 30px;
}
.link-card {
margin-bottom: 20px;
}
.card-header {
display: flex;
align-items: center;
gap: 10px;
font-weight: bold;
}
</style>
<div class="container">
<h1 class="title">Kisechan</h1>
<el-row :gutter="20">
<el-col
v-for="(link, index) in links"
:key="index"
:xs="24"
:sm="12"
:md="8"
:lg="6"
>
<el-card class="link-card">
<template #header>
<div class="card-header">
<el-icon><Link /></el-icon>
<span>{{ link.name }}</span>
</div>
</template>
<el-button type="primary" @click="openLink(link.url)">
前往 {{ link.name }}
</el-button>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script setup>
import { Link } from "@element-plus/icons-vue";
const links = [
{ name: "GitHub", url: "https://github.com/Kisechan" },
{ name: "博客", url: "https://blog.kisechan.space/" },
];
const openLink = (url) => {
window.open(url, "_blank");
};
</script>
<style scoped>
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.title {
text-align: center;
color: #303133;
margin-bottom: 30px;
}
.link-card {
margin-bottom: 20px;
}
.card-header {
display: flex;
align-items: center;
gap: 10px;
font-weight: bold;
}
</style>