记录SpringBoot&vue

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了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值