Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >使用 Spring Boot + Vue + ElementUI 构建简易评分系统

使用 Spring Boot + Vue + ElementUI 构建简易评分系统

原创
作者头像
繁依Fanyi
发布于 2024-07-27 15:03:58
发布于 2024-07-27 15:03:58
29300
代码可运行
举报
运行总次数:0
代码可运行

在这篇博客中,我将带领大家一步一步地构建一个简易评分系统。这个项目会使用 Spring Boot 作为后端,Vue 作为前端框架,并结合 ElementUI 提供用户界面的组件。我们将详细介绍项目的设计思路和实现过程,并在此过程中学习如何将这些技术整合在一起。请系好安全带,准备好一起探索这个有趣的项目吧!

项目简介

评分系统是许多应用程序中的常见功能。无论是商品评价、文章评分,还是服务满意度调查,评分系统都能够帮助用户表达意见,并为其他用户提供参考。在这个项目中,我们将构建一个简易的评分系统,用户可以对特定项目进行评分,并查看所有评分的统计结果。

项目架构

首先,让我们来了解一下整个项目的架构。项目分为前后端两个部分:

  1. 后端(Spring Boot):负责处理业务逻辑、数据存储API 接口。
  2. 前端(Vue + ElementUI):负责展示用户界面,收集用户输入,并与后端交互。
目录结构

项目的目录结构如下:

代码语言:txt
AI代码解释
复制
rating-system/
├── backend/           # 后端代码
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/
│   │   │   ├── resources/
│   │   └── test/
├── frontend/          # 前端代码
│   ├── public/
│   ├── src/
│   ├── package.json
├── README.md

后端开发

1. 创建 Spring Boot 项目

首先,我们需要创建一个新的 Spring Boot 项目。可以使用 Spring Initializr 生成项目模板,选择以下依赖项:

  • Spring Web
  • Spring Data JPA
  • H2 Database(或其他你喜欢的数据库
  • Lombok

项目创建完成后,在 application.properties 文件中配置数据库连接:

代码语言:properties
AI代码解释
复制
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
2. 创建实体类和数据访问层

我们需要一个实体类来表示评分记录。创建一个名为 Rating 的实体类:

代码语言:java
AI代码解释
复制
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.Data;

@Entity
@Data
public class Rating {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String itemName; // 被评分的项目名称
    private int score; // 评分
}

然后,创建一个 JPA 仓库接口来访问数据库:

代码语言:java
AI代码解释
复制
import org.springframework.data.jpa.repository.JpaRepository;

public interface RatingRepository extends JpaRepository<Rating, Long> {
}
3. 创建服务层和控制器

接下来,我们需要创建服务层和控制器来处理业务逻辑和 API 请求。服务层负责业务逻辑的处理,控制器负责接收客户端的请求并返回响应。

创建一个 RatingService 类:

代码语言:java
AI代码解释
复制
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RatingService {

    @Autowired
    private RatingRepository ratingRepository;

    public List<Rating> getAllRatings() {
        return ratingRepository.findAll();
    }

    public Rating addRating(Rating rating) {
        return ratingRepository.save(rating);
    }
}

然后,创建一个 RatingController 类:

代码语言:java
AI代码解释
复制
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/ratings")
public class RatingController {

    @Autowired
    private RatingService ratingService;

    @GetMapping
    public List<Rating> getAllRatings() {
        return ratingService.getAllRatings();
    }

    @PostMapping
    public Rating addRating(@RequestBody Rating rating) {
        return ratingService.addRating(rating);
    }
}

前端开发

1. 创建 Vue 项目

首先,我们需要创建一个新的 Vue 项目。可以使用 Vue CLI 创建项目:

代码语言:bash
AI代码解释
复制
vue create frontend

在项目创建过程中,选择默认配置即可。项目创建完成后,安装 ElementUI:

代码语言:bash
AI代码解释
复制
npm install element-ui --save

然后,在 src/main.js 文件中引入 ElementUI:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import Vue from 'vue';
import App from './App.vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

new Vue({
  render: h => h(App),
}).$mount('#app');
2. 创建评分组件

接下来,我们创建一个评分组件,用于显示评分列表和添加新评分。创建一个名为 Rating.vue 的文件:

代码语言:vue
AI代码解释
复制
<template>
  <div>
    <el-form @submit.prevent="addRating">
      <el-form-item label="项目名称">
        <el-input v-model="newRating.itemName"></el-input>
      </el-form-item>
      <el-form-item label="评分">
        <el-rate v-model="newRating.score"></el-rate>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addRating">提交</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="ratings">
      <el-table-column prop="itemName" label="项目名称"></el-table-column>
      <el-table-column prop="score" label="评分"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      newRating: {
        itemName: '',
        score: 0,
      },
      ratings: [],
    };
  },
  methods: {
    async fetchRatings() {
      const response = await axios.get('/api/ratings');
      this.ratings = response.data;
    },
    async addRating() {
      const response = await axios.post('/api/ratings', this.newRating);
      this.ratings.push(response.data);
      this.newRating.itemName = '';
      this.newRating.score = 0;
    },
  },
  mounted() {
    this.fetchRatings();
  },
};
</script>

在上面的代码中,我们使用 ElementUI 提供的表单和表格组件来创建评分界面,并使用 Axios 进行 API 请求。

3. 将组件集成到主应用

src/App.vue 文件中集成 Rating.vue 组件:

代码语言:vue
AI代码解释
复制
<template>
  <div id="app">
    <Rating />
  </div>
</template>

<script>
import Rating from './components/Rating.vue';

export default {
  name: 'App',
  components: {
    Rating,
  },
};
</script>

<style>
#app {
  padding: 20px;
}
</style>

项目运行

到这里,我们已经完成了所有的代码编写。接下来,分别启动前后端服务:

  1. 启动 Spring Boot 后端服务:
代码语言:bash
AI代码解释
复制
cd backend
mvn spring-boot:run
  1. 启动 Vue 前端服务:
代码语言:bash
AI代码解释
复制
cd frontend
npm run serve

打开浏览器访问 http://localhost:8080,你将看到评分系统的界面,用户可以添加评分并查看所有评分记录。

进一步完善评分系统

在上一部分,我们已经完成了一个简易评分系统的基本功能。然而,要让系统更加完善和实用,我们还需要注意一些细节问题,并介绍更多的知识点和实现思路。在这部分中,我们将深入探讨如何优化评分系统,包括使用 el-rate 组件、处理异常、验证用户输入、增加评分统计等。

使用 el-rate 组件

el-rate 是 ElementUI 提供的评分组件,使用非常简单,可以为用户提供直观的评分界面。接下来,我们将详细介绍如何在项目中使用 el-rate 组件,并进一步优化评分功能。

1. 优化评分组件

在前面的代码中,我们已经使用了 el-rate 组件来收集用户的评分。现在,让我们进一步优化这个组件,为用户提供更好的使用体验。

更新 Rating.vue 文件:

代码语言:vue
AI代码解释
复制
<template>
  <div>
    <el-form @submit.prevent="addRating" label-width="120px">
      <el-form-item label="项目名称" :error="errors.itemName">
        <el-input v-model="newRating.itemName"></el-input>
      </el-form-item>
      <el-form-item label="评分" :error="errors.score">
        <el-rate v-model="newRating.score"></el-rate>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addRating">提交</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="ratings" style="margin-top: 20px;">
      <el-table-column prop="itemName" label="项目名称"></el-table-column>
      <el-table-column prop="score" label="评分"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      newRating: {
        itemName: '',
        score: 0,
      },
      ratings: [],
      errors: {
        itemName: '',
        score: '',
      },
    };
  },
  methods: {
    async fetchRatings() {
      const response = await axios.get('/api/ratings');
      this.ratings = response.data;
    },
    validateForm() {
      let isValid = true;
      this.errors = {
        itemName: '',
        score: '',
      };
      if (!this.newRating.itemName) {
        this.errors.itemName = '项目名称不能为空';
        isValid = false;
      }
      if (this.newRating.score <= 0) {
        this.errors.score = '评分不能为空';
        isValid = false;
      }
      return isValid;
    },
    async addRating() {
      if (!this.validateForm()) {
        return;
      }
      try {
        const response = await axios.post('/api/ratings', this.newRating);
        this.ratings.push(response.data);
        this.newRating.itemName = '';
        this.newRating.score = 0;
      } catch (error) {
        console.error('添加评分失败', error);
      }
    },
  },
  mounted() {
    this.fetchRatings();
  },
};
</script>

<style scoped>
/* 自定义样式 */
</style>

在这个优化后的组件中,我们添加了表单验证功能,确保用户输入的项目名称和评分不为空。同时,我们使用 el-form-item:error 属性来显示错误信息。

2. 增加评分统计

为了让用户更直观地了解评分情况,我们可以增加评分统计功能,比如显示平均评分和评分次数。让我们来实现这个功能。

Rating.vue 文件中增加以下代码:

代码语言:vue
AI代码解释
复制
<template>
  <div>
    <el-form @submit.prevent="addRating" label-width="120px">
      <el-form-item label="项目名称" :error="errors.itemName">
        <el-input v-model="newRating.itemName"></el-input>
      </el-form-item>
      <el-form-item label="评分" :error="errors.score">
        <el-rate v-model="newRating.score"></el-rate>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addRating">提交</el-button>
      </el-form-item>
    </el-form>
    <el-card style="margin-top: 20px;">
      <div slot="header">
        <span>评分统计</span>
      </div>
      <div>
        <p>平均评分:{{ averageScore }}</p>
        <p>评分次数:{{ ratings.length }}</p>
      </div>
    </el-card>
    <el-table :data="ratings" style="margin-top: 20px;">
      <el-table-column prop="itemName" label="项目名称"></el-table-column>
      <el-table-column prop="score" label="评分"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      newRating: {
        itemName: '',
        score: 0,
      },
      ratings: [],
      errors: {
        itemName: '',
        score: '',
      },
    };
  },
  computed: {
    averageScore() {
      if (this.ratings.length === 0) {
        return 0;
      }
      const totalScore = this.ratings.reduce((sum, rating) => sum + rating.score, 0);
      return (totalScore / this.ratings.length).toFixed(1);
    },
  },
  methods: {
    async fetchRatings() {
      const response = await axios.get('/api/ratings');
      this.ratings = response.data;
    },
    validateForm() {
      let isValid = true;
      this.errors = {
        itemName: '',
        score: '',
      };
      if (!this.newRating.itemName) {
        this.errors.itemName = '项目名称不能为空';
        isValid = false;
      }
      if (this.newRating.score <= 0) {
        this.errors.score = '评分不能为空';
        isValid = false;
      }
      return isValid;
    },
    async addRating() {
      if (!this.validateForm()) {
        return;
      }
      try {
        const response = await axios.post('/api/ratings', this.newRating);
        this.ratings.push(response.data);
        this.newRating.itemName = '';
        this.newRating.score = 0;
      } catch (error) {
        console.error('添加评分失败', error);
      }
    },
  },
  mounted() {
    this.fetchRatings();
  },
};
</script>

<style scoped>
/* 自定义样式 */
</style>

在这个更新后的组件中,我们添加了一个 el-card 来显示评分统计信息。通过计算 averageScore 计算属性,我们可以展示平均评分,并且在评分列表下方显示评分次数。

处理异常

在实际开发中,异常处理是必不可少的一部分。我们需要在前后端都处理好可能出现的异常,确保系统的稳定性和可靠性。

后端异常处理

在 Spring Boot 中,我们可以使用全局异常处理器来捕获和处理所有的异常。创建一个全局异常处理器类:

代码语言:java
AI代码解释
复制
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResponseEntity<?> handleException(Exception ex, WebRequest request) {
        return new ResponseEntity<>("服务器内部错误: " + ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
    }

    // 其他异常处理方法
}

这个类使用了 @ControllerAdvice 注解,可以捕获所有控制器中的异常,并统一处理。在这里,我们简单地返回了一个包含错误信息的响应。

前端异常处理

在前端,我们可以在 Axios 请求中捕获异常,并显示友好的错误提示。前面我们已经在 addRating 方法中添加了异常处理,现在让我们进一步优化这个方法。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
methods: {
  async fetchRatings() {
    try {
      const response = await axios.get('/api/ratings');
      this.ratings = response.data;
    } catch (error) {
      console.error('获取评分失败', error);
      this.$message.error('获取评分失败');
    }
  },
  async addRating() {
    if (!this.validateForm()) {
      return;
    }
    try {
      const response = await axios.post('/api/ratings', this.newRating);
      this.ratings.push(response.data);
      this.newRating.itemName = '';
      this.newRating.score = 0;
      this.$message.success('评分提交成功');
    } catch (error) {
      console.error('添加评分失败', error);
      this.$message.error('添加评分失败');
    }
  },
},

在这个优化后的方法中,我们使用 ElementUI 提供的 this.$message 方法显示成功或失败的提示信息。

用户验证

在某些场景下,我们可能需要对用户进行验证,以确保只有授权用户才能进行评分。为了简单起见,这里我们不实现完整的用户认证系统,但我们可以模拟一个简单的用户验证过程。

假设我们有一个简单的用户系统,用户在评分前需要输入用户名。我们可以在 Rating.vue 文件中添加一个用户名输入框,并在提交评分时进行简单验证。

更新 Rating.vue 文件:

代码语言:vue
AI代码解释
复制
<template>
  <div>
    <el-form @submit.prevent="addRating" label-width="120px">
      <el-form-item label="用户名" :error="errors.username">
        <el-input v-model="username"></el-input>
      </el-form-item>
      <el-form-item label="项目名称" :error="errors.itemName">
        <el-input v-model="newRating.itemName"></el-input>
      </el-form-item>
      <el-form-item label="评分" :error="errors.score">
        <el-rate v-model="newRating.score"></el-rate>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addRating">提交</el-button>
      </el-form-item>
    </el-form>
    <el-card style="margin-top: 20px;">
      <div slot="header">
        <span>评分统计</span>
      </div>
      <div>
        <p>平均评分:{{ averageScore }}</p>
        <p>评分次数:{{ ratings.length }}</p>
      </div>
    </el-card>
    <el-table :data="ratings" style="margin-top: 20px;">
      <el-table-column prop="itemName" label="项目名称"></el-table-column>
      <el-table-column prop="score" label="评分"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      username: '',
      newRating: {
        itemName: '',
        score: 0,
      },
      ratings: [],
      errors: {
        username: '',
        itemName: '',
        score: '',
      },
    };
  },
  computed: {
    averageScore() {
      if (this.ratings.length === 0) {
        return 0;
      }
      const totalScore = this.ratings.reduce((sum, rating) => sum + rating.score, 0);
      return (totalScore / this.ratings.length).toFixed(1);
    },
  },
  methods: {
    async fetchRatings() {
      try {
        const response = await axios.get('/api/ratings');
        this.ratings = response.data;
      } catch (error) {
        console.error('获取评分失败', error);
        this.$message.error('获取评分失败');
      }
    },
    validateForm() {
      let isValid = true;
      this.errors = {
        username: '',
        itemName: '',
        score: '',
      };
      if (!this.username) {
        this.errors.username = '用户名不能为空';
        isValid = false;
      }
      if (!this.newRating.itemName) {
        this.errors.itemName = '项目名称不能为空';
        isValid = false;
      }
      if (this.newRating.score <= 0) {
        this.errors.score = '评分不能为空';
        isValid = false;
      }
      return isValid;
    },
    async addRating() {
      if (!this.validateForm()) {
        return;
      }
      try {
        const response = await axios.post('/api/ratings', this.newRating);
        this.ratings.push(response.data);
        this.newRating.itemName = '';
        this.newRating.score = 0;
        this.$message.success('评分提交成功');
      } catch (error) {
        console.error('添加评分失败', error);
        this.$message.error('添加评分失败');
      }
    },
  },
  mounted() {
    this.fetchRatings();
  },
};
</script>

<style scoped>
/* 自定义样式 */
</style>

在这个更新后的组件中,我们添加了用户名输入框,并在提交评分时验证用户名是否为空。这样可以确保用户在评分前输入用户名。

部署和测试

在完成所有功能后,我们需要将项目部署到服务器上进行测试。这里简单介绍一下如何部署 Spring Boot 和 Vue 项目。

部署 Spring Boot 项目

将 Spring Boot 项目打包成可执行的 jar 文件:

代码语言:bash
AI代码解释
复制
cd backend
mvn clean package

然后,将生成的 jar 文件上传到服务器并运行:

代码语言:bash
AI代码解释
复制
java -jar backend/target/rating-system-0.0.1-SNAPSHOT.jar
部署 Vue 项目

将 Vue 项目打包成静态文件:

代码语言:bash
AI代码解释
复制
cd frontend
npm run build

然后,将生成的 dist 文件夹中的静态文件上传到服务器的 Web 服务器目录中(例如 Nginx 或 Apache)。

配置 Web 服务器(以 Nginx 为例):

代码语言:nginx
AI代码解释
复制
server {
    listen 80;
    server_name yourdomain.com;

    location / {
        root /path/to/your/dist;
        try_files $uri $uri/ /index.html;
    }

    location /api {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

结论

在这篇博客中,我们详细介绍了如何使用 Spring Boot、Vue 和 ElementUI 构建一个简易评分系统。通过这个项目,你可以学习到如何构建前后端分离的应用程序,并将不同技术栈的组件整合在一起。我们还深入探讨了使用 el-rate 组件、处理异常、验证用户输入、增加评分统计等高级功能。

希望这篇博客能帮助你更好地理解这些技术的使用,并激发你在实际项目中应用这些知识的灵感。如果你对这个项目有任何问题或建议,欢迎在评论区留言。感谢你的阅读,祝你编码愉快!

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
手把手教你搭建Spring Boot+Vue前后端分离
前后端分离是目前互联网开发中比较广泛使用的开发模式,主要是将前端和后端的项目业务进行分离,可以做到更好的解耦合,前后端之间的交互通过xml或json的方式,前端主要做用户界面的渲染,后端主要负责业务逻辑和数据的处理。
闫同学
2022/10/31
7.2K0
手把手教你搭建Spring Boot+Vue前后端分离
Spring+Vue增删改查实例
前端地址:https://github.com/Snowstorm0/SpringAndVue-vue
代码的路
2022/08/23
3480
Spring+Vue增删改查实例
二十分钟秒懂:实现前后端分离开发(vue+element+spring boot+mybatis+MySQL)
综上所述,Vue.js 和 Spring Boot 都有各自的优势,它们可以很好地配合使用,实现高效的全栈开发。Vue.js 负责前端 UI 的实现和交互逻辑,Spring Boot 负责后端业务逻辑的实现和数据处理。
淼学派对
2023/10/14
20.9K0
二十分钟秒懂:实现前后端分离开发(vue+element+spring boot+mybatis+MySQL)
一步步使用SpringBoot结合Vue实现登录和用户管理功能
前后端分离开发是当今开发的主流。本篇文章从零开始,一步步使用SpringBoot结合Vue来实现日常开发中最常见的登录功能,以及登录之后对用户的管理功能。通过这个例子,可以快速入门SpringBoot+Vue前后端分离的开发。
三分恶
2021/02/01
2.5K0
一步步使用SpringBoot结合Vue实现登录和用户管理功能
vue2.0+Element-ui实战案例
我们将会选择使用一些 vue 周边的库vue-cli, vue-router,axios,moment,Element-ui搭建一个前端项目案例,后端数据接口,会使用json-server快速搭建一个本地的服务,方便对数据的增删改查,
小周sir
2019/09/23
2.3K0
vue2.0+Element-ui实战案例
vue实战电商管理后台
这里我们使用了 ElementUI 组件 el-container、el-menu
Remember_Ray
2020/10/09
4.6K2
vue实战电商管理后台
【源码免费下载】SpringBoot整合Spring+SpringMVC+MyBatisPlus案例:图书管理系统
只是上述调用MyBatisPlus中提供的分页功能相关的方法还无法真正实现分页功能,MyBatisPlu是通过拦截器来实现分页的,所以需要配置拦截器。
.29.
2023/10/17
4250
【源码免费下载】SpringBoot整合Spring+SpringMVC+MyBatisPlus案例:图书管理系统
IDEA+SSM+SpringBoot+Vue+Element UI实现班级管理增删改查
环境搭建 SQL CREATE TABLE `tb_class` ( `c_id` varchar(32) NOT NULL COMMENT '班级ID', `c_name` varchar(50) DEFAULT NULL COMMENT '班级名称', `desc` varchar(200) DEFAULT NULL COMMENT '班级描述', PRIMARY KEY (`c_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for
陶然同学
2023/02/27
1.3K0
IDEA+SSM+SpringBoot+Vue+Element UI实现班级管理增删改查
ElementUI快速入门
在执行完npm run dev后发现浏览器自动打开了vue-admin-template登录页面,点击登录,此时模板页面就搭建好了。
Java架构师必看
2021/05/14
3.2K0
ElementUI快速入门
Element-UI 快速入门指南
在开始使用 Element-UI 之前,我们需要先安装它。可以使用 npm 或 yarn 进行安装。
IT_陈寒
2024/05/24
1.2K0
Element-UI 快速入门指南
Vue 前后端分离项目(二)
简介 Vue项目 启动项目:npm run serve Router index.js import Vue from 'vue' import VueRouter from 'vue-router' import Home from '../views/Home.vue' import Pie from '../views/Pie.vue' import Table from '../views/Table.vue' import Edit from '../views/Edit.vue' import
HLee
2021/06/27
4660
Vue 前后端分离项目(二)
二开vue-admin-template-4-curd
腾云先锋(TDP,Tencent Cloud Developer Pioneer)是腾讯云GTS官方组建并运营的技术开发者群体。这里有最专业的开发者&客户,能与产品人员亲密接触,专有的问题&需求反馈渠道,有一群志同道合的兄弟姐妹。来加入属于我们开发者的社群吧!
无敌小菜鸟
2022/04/02
3850
二开vue-admin-template-4-curd
9. 前后台协议联调
(2)后台返回操作结果,将 Dao 层的增删改方法返回值从void​ 改成int​
捞月亮的小北
2023/12/01
2150
9. 前后台协议联调
结合Vue案例梳理前端设计模式
设计模式是一套被反复使用、多数人知晓、经过分类编目的、代码设计经验的总结。它是为了可重用代码,让代码更容易的被他人理解并保证代码的可靠性。
@超人
2023/05/12
5780
结合Vue案例梳理前端设计模式
学生管理系统Element UI版
链接:https://pan.baidu.com/s/1FAb2WUSUwpRuwIB9Spy3oQ  提取码:1234
陶然同学
2023/02/24
1.5K0
学生管理系统Element UI版
Vue + Element UI 实现权限管理系统 前端篇(十二)
 而具体的Mock接口,把根路径移除,因为在生成Mock的时候会自动把根路径加上去。
朝雨忆轻尘
2019/06/18
1.4K0
SpringBoot-Vue 前后端分离开发
vue安装最新版本 npm install -g @vue/cli 或 yarn global add @vue/cli
千羽
2021/01/14
7750
SpringBoot-Vue 前后端分离开发
谷粒学院day5 讲师管理模块的前端实现
前端页面登录的url经常会挂掉,要改为本地地址。启动前端的demo项目。浏览器右键选择inspect打开调试界面,切到Network,点击Login,具体操作参考下图。
半旧518
2022/10/26
4.6K0
谷粒学院day5 讲师管理模块的前端实现
Vue 前后端分离项目(一)
Vue访问永远都是App.vue,然后用<router-view></router-view>开启了一个小窗口进行页面路由,相当于一个容器,用来动态渲染你选择的router。
HLee
2021/06/20
1.6K1
Vue 前后端分离项目(一)
从零到部署:用 Vue 和 Express 实现迷你全栈电商应用(七)
在之前的六篇教程中我们已经基本实现了迷你全栈电商应用,相信大家对于一个全栈应用的开发已经有了一个全面的认知。但是一个追求完美的工程师是不会吝啬他的艺术创造,仅仅实现应用的功能还不能满足用户的高需求,应用的界面效果也是提高用户体验的关键因素。因此本篇教程将基于 element-ui 组件库重构项目的前端代码,改善迷你电商应用的界面效果,提高用户的体验感。虽然我们可以轻松地引入现成的组件库,但是与之对应的数据处理也值得我们注意,那我会在引入组件库的同时带大家一起踩一踩 element-ui 给我们挖的坑,毕竟踩坑才能成长嘛。
一只图雀
2020/04/07
1.6K0
相关推荐
手把手教你搭建Spring Boot+Vue前后端分离
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验