1.標簽跳轉
<router-link to='two.html'><button>點我到第二個頁面</button></router-link>
2.點擊事件跳轉
htm:
<el-button type="primary" @click="doLogin">登錄</el-button>
js:
methods: {
doLogin() {
var that = this;
axios
.post('http://localhost/doLogin', this.loginData)
.then(function (response) {
console.log(response);
if (response.data =https://www.cnblogs.com/ckfeng/p/= "ok") {
that.$router.push({path: './Index'})
}
})
.error(function (error) {
console.log(error)
})
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/187927.html
標籤:Java
