一、Spring Boot 基础
Spring Boot 是 Spring 框架的一个子集,通过提供默认配置和简化依赖管理,使得开发者能够快速构建和运行 Spring 应用程序。以下是一个简单的 Spring Boot 应用程序示例,该示例将展示一个基本的 Web 服务。
HelloWorldApplication.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}
@GetMapping("/hello")
public String helloWorld() {
return "Hello, World!";
}
}
二、Vue.js 基础
Vue.js 是一种流行的 JavaScript 框架,通过虚拟 DOM 技术实现了高效的 DOM 操作,并提供了响应式数据绑定和组件化开发模式。以下是一个简单的 Vue.js 应用程序示例,该示例将展示如何创建一个简单的数据绑定和事件处理。
index.html
<!DOCTYPE html>
<html>
<head>
<title>Vue.js Demo</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
{{ message }}
Change Message


