查看
npm config get registry
设置淘宝
npm config set registry=https://registry.npm.taobao.orgVue脚手架安装
npm install -g @vue/cli@4.5.15安装element-ui包,在终端执行以下命令
npm i element-ui在main.js中写入以下内容
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
Vue.use(ElementUI);
new Vue({
el: '#app',
render: h => h(App)
});
前后端分离解决跨越问题
在Controller类上加上如下注解
@CrossOrigin(origins = {"*", "null"})
安装axios
npm i axios基本使用
import axios from 'axios'
axios.get('http://localhost:8000/students').then(
response => {
console.log(response.data);
},
error =>{
console.log(error.massage);
}
)
后端配置文件
pom.xml
application.yaml4.0.0 org.example mybatis_plus01 1.0-SNAPSHOT 8 8 org.springframework.boot spring-boot-starter-parent 2.6.7 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-starter-web com.baomidou mybatis-plus-boot-starter 3.5.1 org.projectlombok lombok true mysql mysql-connector-java runtime com.google.code.gson gson 2.8.5
spring:
datasource:
username: demo
password: 'demo'
url: jdbc:mysql://127.0.0.1:3306/demo?characterEncoding=UTF-8&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
启动类
package org.example;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("org.example.mapper")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}



