Spring Boot
报错:
com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
解决:在application.properties中url后面加 &useSSL=false
还是报错:
com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
解决:检查并重启MySQL
VUE
在VS code新建vue项目
> vue init webpack
? Generate project in current directory? Yes
? Project name demo3_vue
? Project description A Vue.js project
? Author RubiaCx <1084281732@qq.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm
项目依赖:
1. 数据请求 “axios”: “^0.18.0”,
2. 图表控件 “echarts”: “^4.2.0-rc.2”,
3. 富文本编辑器 “vue-quill-editor”: “^3.0.6”,
4. 路由 “vue-router”: “^3.0.1”,
5.状态管理 “vuex”: “^3.0.1”
6.数据模拟 “mockjs”: “^1.0.1-beta3”,
7.ElementUI “element-ui”: “^2.4.11”,
8.VUE “vue”: “^2.5.17”,
问题:页面空白
解决:检查路径
报错:
Access to XMLHttpRequest at 'http://localhost:8083/person/List' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
解决前端跨域:
@CrossOrigin
问题:白边
解决:
index.html
<style type="text/css">
body {
margin: 0;
}
</style>
报错:
NavigationDuplicated: Avoided redundant navigation to current location: "/#/Users".
解决:
在router/index.js中加入
const originlPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originlPush.call(this, location).catch(err => err)
}
路由跳转坑:
- 嵌套路由,跳转页面空白
原因一:
没有在父路由中加上<router-view> </router-view>
,来将对应的组件内容渲染到router-view。
原因二:
子路由path加了‘/’。
以“/”开头的嵌套路径会被当作根路径,所以子路由上不用加“/”;在生成路由时,主路由上的path会被自动添加到子路由之前,所以子路由上的path不用在重新声明主路由上的path了。