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

35
package-lock.json generated
View File

@ -15,6 +15,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"path": "^0.12.7",
"vite": "^6.2.0"
}
},
@ -1091,6 +1092,12 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==",
"dev": true
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -1146,6 +1153,16 @@
"resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
},
"node_modules/path": {
"version": "0.12.7",
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
"integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
"dev": true,
"dependencies": {
"process": "^0.11.1",
"util": "^0.10.3"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@ -1178,6 +1195,15 @@
"node": "^10 || ^12 || >=14"
}
},
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
"dev": true,
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/rollup": {
"version": "4.34.9",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.9.tgz",
@ -1224,6 +1250,15 @@
"node": ">=0.10.0"
}
},
"node_modules/util": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
"dev": true,
"dependencies": {
"inherits": "2.0.3"
}
},
"node_modules/vite": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz",

View File

@ -16,6 +16,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"path": "^0.12.7",
"vite": "^6.2.0"
}
}

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>

View File

@ -1,7 +1,12 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path' // 引入 path 模块
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
})
resolve: {
alias: {
'@': path.resolve(__dirname, './src') // 配置 @ 别名
}
}
})