Vue+SpringBoot+ElementUI实战学生管理系统-2.搭建Vue+elementUI脚手架

1.项目介绍

前一片介绍了项目的整体情况,这一篇开始搭建前端工程,需要的朋友可以拿去自己定制。:)

2.获取源码

源码是捐赠方式获取,详细请QQ联系我 :)!

3.项目截图

登录页

在这里插入图片描述

列表操作

在这里插入图片描述
在这里插入图片描述

动态图

在这里插入图片描述

4.搭建前端工程

只挑关键步骤讲,详细看源码。

安装NodeJS

http://nodejs.cn/ 下载安装包安装。

安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

安装webpack

npm install webpack webpack-cli --save-dev

安装Vue和脚手架

cnpm install vue -g
cnpm install vue-cli -g

创建项目

利用Vue脚手架搭建vue项目。

cmd执行,vue ui,打开vue脚手架页面,按向导指示安装。

详细参考:https://blog.csdn.net/IndexMan/article/details/107364648

配置路由

以学生管理系统为例

  • 修改router/index.js
// 路由懒加载
const Login = () => import("../components/Login.vue");
const Home = () => import("../components/Home.vue");

const Users = () => import("../components/user/User.vue");
const Dept = () => import("../components/Dept.vue");
const Grade = () => import("../components/Grade.vue");
const Major = () => import("../components/Major.vue");
const Teacher = () => import("../components/Teacher.vue");
const Student = () => import("../components/Student.vue");

Vue.use(VueRouter);

const routes = [
  { path: "/", redirect: "/login" },
  { path: "/login", component: Login },
  {
    path: "/home",
    component: Home,
    redirect: "/student",
    children: [
      { path: "/users", component: Users },
      { path: "/dept", component: Dept },
      { path: "/grade", component: Grade },
      { path: "/major", component: Major },
      { path: "/teacher", component: Teacher },
      { path: "/student", component: Student }
    ]
  }
];

const router = new VueRouter({
  routes
});

配置组件库

安装element插件:vue-cli-plugin-element

配置axios库

  • 安装运行依赖:axios
  • 安装开发依赖:less-loader、less
  • 自定义eslint检查规则:
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    // allow paren-less arrow functions
    'arrow-parens': 0,
    // allow async-await
    'generator-star-spacing': 0,
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
    "no-unused-vars": [2, {
      // 允许声明未使用变量
      "vars": "local",
      // 参数不检查
      "args": "none"
    }],
    // 关闭语句强制分号结尾
    "semi": [0],
    //空行最多不能超过100行
    "no-multiple-empty-lines": [0, {"max": 100}],
    //关闭禁止混用tab和空格
    "no-mixed-spaces-and-tabs": [0],
  }
}

托管到git(非必须)

托管到码云新建仓库:vue_student。

开发新功能时先创建分支:git checkout -b login

如何切换分支 :git checkout master

如何合并login分支:git merge login

如何推送master分支:git push

如何推送本地login分支:git push -u origin login

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
在Spring Boot中整合VueElementUI的项目,可以按照以下步骤进行配置: 1. 首先,在Spring Boot的启动类中添加@SpringBootApplication注解,并使用@MapperScan注解扫描Mapper包。这样可以将Spring Boot应用程序标记为主应用程序,并扫描指定的Mapper包。 2. 在前端项目中,通常会使用JavaScript框架Vue和UI组件库ElementUI。在main.js文件中,需要导入ElementUI并引入其样式文件。这可以通过添加以下三行代码来实现:import ElementUI from 'element-ui'、import 'element-ui/lib/theme-chalk/index.css'、Vue.use(ElementUI)。这样就可以在Vue项目中使用ElementUI的组件了。 3. Spring Boot是一个框架,它默认配置了很多框架的使用方式。通过使用Spring Boot,可以简化开发过程,整合和管理各种框架。对于Spring Boot和Vue项目,你可以使用Spring Boot提供的特性,如自动化配置、依赖管理和集成测试等。这样可以更高效地搭建和开发项目。 综上所述,Spring Boot、VueElementUI的整合项目可以通过在Spring Boot的启动类中添加注解、在Vue项目中导入ElementUI的相关代码来实现。这样可以充分利用Spring Boot的框架特性和简化开发过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Vue+ElementUI+Springboot实现前后端分离的一个demo](https://blog.csdn.net/weixin_42032770/article/details/118881371)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [springboot+vue+element-ui全栈开发入门--开篇](https://blog.csdn.net/g1607058603/article/details/86737567)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值