今天的主要内容包括:基础环境的搭建、前端头部页面的编写、前端主体页面的编写等,今天的内容学起来会比较轻松,加油!下面就开始今天的学习!













<template>
<div>
<div style="display: flex; height: 60px; line-height: 60px; border-bottom: 1px solid #eee">
<div style="width: 300px; display: flex; padding-left: 30px">
<div style="width: 60px">
<img src="../../assets/logoSub.png" alt=""
style="width: 50px; position: relative; top: 5px; right: 0">
div>
<div style="flex: 1">欢迎来到xx系统div>
div>
<div style="flex: 1">
<el-menu :default-active="'1'" class="el-menu-demo" mode="horizontal" router>
<el-menu-item index="/front/home">首页el-menu-item>
<el-menu-item>视频播放el-menu-item>
<el-menu-item>文章列表el-menu-item>
<el-submenu index="2">
<template slot="title">我的工作台template>
<el-menu-item>选项1el-menu-item>
<el-menu-item index="2-2">选项2el-menu-item>
<el-menu-item index="2-3">选项3el-menu-item>
<el-submenu index="2-4">
<template slot="title">选项4template>
<el-menu-item index="2-4-1">选项1el-menu-item>
<el-menu-item index="2-4-2">选项2el-menu-item>
<el-menu-item index="2-4-3">选项3el-menu-item>
el-submenu>
el-submenu>
el-menu>
div>
<div style="width: 200px">
<div v-if="!user.username" style="text-align: right; padding-right: 30px">
<el-button @click="$router.push('/login')">登录el-button>
<el-button @click="$router.push('/register')">注册el-button>
div>
<div v-else>
<el-dropdown style="width: 150px; cursor: pointer; text-align: right">
<div style="display: inline-block">
<img :src="user.avatar" alt=""
style="width: 30px; border-radius: 50%; position: relative; top: 10px; right: 5px">
<span>{{ user.nickname }}span><i class="el-icon-arrow-down" style="margin-left: 5px">i>
div>
<el-dropdown-menu slot="dropdown" style="width: 100px; text-align: center">
<el-dropdown-item style="font-size: 14px; padding: 5px 0">
<router-link to="/password" style="text-decoration: none">修改密码router-link>
el-dropdown-item>
<el-dropdown-item style="font-size: 14px; padding: 5px 0">
<router-link to="/person" style="text-decoration: none">个人信息router-link>
el-dropdown-item>
<el-dropdown-item style="font-size: 14px; padding: 5px 0">
<span style="text-decoration: none" @click="logout">退出span>
el-dropdown-item>
el-dropdown-menu>
el-dropdown>
div>
div>
div>
<div style="width: 1000px; margin: 0 auto">
<router-view/>
div>
div>
template>
<script>
export default {
name: "Front",
data() {
return {
user: localStorage.getItem("user") ? JSON.parse(localStorage.getItem("user")) : {}
}
},
created() {
},
methods: {
logout() {
this.$store.commit("logout")
this.$message.success("退出成功")
}
}
}
script>
<style>
.item {
display: inline-block;
width: 100px;
text-align: center;
cursor: pointer
}
.item a {
color: #1E90FF;
}
.item:hover {
background-color: LightPink;
}
style>




<template>
<div>
<div style="margin: 10px 0">
<el-carousel height="450px" :interval="10000">
<el-carousel-item v-for="item in imgs" :key="item">
<img :src="item" alt="" style="width: 100%">
el-carousel-item>
el-carousel>
div>
<div style="margin: 10px 0">
<el-row :gutter="10">
<el-col :span="6" v-for="item in files" :key="item.id" style="margin-bottom: 10px">
<div style="border: 1px solid #ccc; padding-bottom: 10px">
<img :src="item.url" alt="" style="width: 100%">
<div style="color: #666; padding: 10px">{{ item.name }}div>
<div style="padding: 10px">
<el-button type="primary">购买el-button>
div>
div>
el-col>
el-row>
div>
div>
template>
<script>
export default {
name: "FrontHome",
data() {
return {
imgs: [
'https://img30.360buyimg.com/babel/s1580x830_jfs/t1/109361/24/22897/74054/621ede58E099d37e3/f12730c81df6046a.jpg!cc_1580x830.webp',
'https://img13.360buyimg.com/babel/s1580x830_jfs/t1/96398/30/23715/70228/6221e9d0Ec1b9fe65/f66e2ad76314d6cd.jpg!cc_1580x830.webp'
],
files: []
}
},
created() {
this.request.get("/echarts/file/front/all").then(res => {
console.log(res.data)
this.files = res.data.filter(v => v.type === 'png' || v.type === 'jpg' || v.type === 'webp')
})
},
methods: {}
}
script>
<style>
style>

以上就是今天学习的全部内容,明天将会给大家带来关于SpringBoot集成Redis实现缓存的相关内容。明天见!