优化一些细节
Former-commit-id: d40c51afd20ff6c8b75343b110c4a885494d13d6 [formerly d40c51afd20ff6c8b75343b110c4a885494d13d6 [formerly d40c51afd20ff6c8b75343b110c4a885494d13d6 [formerly d40c51afd20ff6c8b75343b110c4a885494d13d6 [formerly 8e89c9de19c7589bfef2ed381c4d04e5ffa10342 [formerly 43a6b0713d5f72c905ec7115dee22d64349905bc]]]]] Former-commit-id: 7f951c4f7afbcde61758bc064d58b48a27f60b2e Former-commit-id: 3ae33b4cb8fd3a6e217ea188db468378ec45a755 Former-commit-id: c1fbcedaf8f0742871894db45bc4f5fdd0a81401 [formerly fc2d9e0c6f21015a6a40af6baa2ea77cfe6e07d2] Former-commit-id: a4fb93d4c675d59173e6a44897a17f27c36f7cea Former-commit-id: e1d7b3b4afc1221bfc31a8079b05b1cc0bf2ee3e Former-commit-id: 78de6f0e3afe650160da32723a88e8d5337fbbf2 Former-commit-id: 1e79f8a1bb257fba62c3a711741f788e2f61cb8e Former-commit-id: d6563a9fbd5956d549fa6dc7ae36045d922da1fb
This commit is contained in:
@@ -55,12 +55,12 @@ export default {
|
|||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
// 监听路由 控制侧边栏激活状态
|
// 监听路由 控制侧边栏激活状态
|
||||||
'$route.matched': {
|
'$route': {
|
||||||
handler (val) {
|
handler ({ fullPath }) {
|
||||||
this.active = val[val.length - 1].path
|
this.active = fullPath
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.aside.length > 0 && this.$refs.menu) {
|
if (this.aside.length > 0 && this.$refs.menu) {
|
||||||
this.$refs.menu.activeIndex = this.active
|
this.$refs.menu.activeIndex = fullPath
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<d2-container type="card">
|
<d2-container type="card">
|
||||||
<template slot="header">这个页面会被 keep-alive</template>
|
<template slot="header">这个页面会被 keep-alive</template>
|
||||||
<h1>编号:{{id}}</h1>
|
<h2 class="d2-mt-0">编号:{{id}}</h2>
|
||||||
<p class="d2-mt-0">在下面的输入框输入任意字符后,切换到其它页面,再回到此页时输入框文字保留,证明被缓存</p>
|
<p class="d2-mt-0">在下面的输入框输入任意字符后,切换到其它页面,再回到此页时输入框文字保留,证明被缓存</p>
|
||||||
<el-input v-model="value" placeholder="input here"></el-input>
|
<el-input v-model="value" placeholder="input here"></el-input>
|
||||||
</d2-container>
|
</d2-container>
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ export default {
|
|||||||
* @param {Object} param vm {Object} vue 实例
|
* @param {Object} param vm {Object} vue 实例
|
||||||
* @param {Object} param username {String} 用户账号
|
* @param {Object} param username {String} 用户账号
|
||||||
* @param {Object} param password {String} 密码
|
* @param {Object} param password {String} 密码
|
||||||
* @param {Object} param route {Object} 登录成功后定向的路由对象
|
* @param {Object} param route {Object} 登录成功后定向的路由对象 任何 vue-router 支持的格式
|
||||||
*/
|
*/
|
||||||
login ({ dispatch }, {
|
login ({ dispatch }, {
|
||||||
vm,
|
vm,
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
route = {
|
route = {
|
||||||
name: 'index'
|
path: '/'
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
// 开始请求登录接口
|
// 开始请求登录接口
|
||||||
|
|||||||
Reference in New Issue
Block a user