跳转方式:
this.$router.replace(’/schoolmanager’).catch(res => {})this.$router.go(-1)
this.$router.back
常用的两种处理数据的方式:
one:
const p1 = this.$refs.validator0.validate()
p1.then(res => {
if (this.valid) {
sessionStorage.setItem('number', this.new_number)
this.$router.go(-1)
} else {
}
})
异步调用 promise 数组filter,map,every…
two:
Promise.all([p1, p2]).then(res => {
})
登录页面代码:>>>
<template>
<div class="page">
<div class="header">用户登录</div>
<div class="row">
<cube-select v-model="role" :options="roles"></cube-select>
</div>
<div class="row">
<cube-validator ref="validator0" v-model="valid" :model="tel" :rules="rules[0]">
<cube-input v-model='tel' :placeholde