Files
my-bigScreen/screen-vue/src/views/system/index.vue
2026-03-01 21:28:05 +08:00

42 lines
969 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 模板部分只能有一个根元素用div包裹 -->
<div class="sys-home-container">
<el-card title="系统首页" shadow="hover">
<div class="home-content">
<h2>欢迎使用后台管理系统</h2>
<p>当前访问路径/syshome</p>
<p>这是 Layout 子路由的正常渲染内容不会展示代码</p>
<el-button type="primary" @click="testBtn">测试按钮</el-button>
</div>
</el-card>
</div>
</template>
<script setup>
// 脚本部分使用setup语法糖无语法错误
import { ElMessage } from 'element-plus'
// 测试方法
const testBtn = () => {
ElMessage.success('按钮点击成功!')
}
</script>
<style scoped>
/* 样式部分scoped确保样式隔离 */
.sys-home-container {
padding: 10px;
height: 100%;
}
.home-content {
margin-top: 20px;
font-size: 16px;
color: #333;
}
.home-content h2 {
color: #409eff;
margin-bottom: 15px;
}
</style>