保存进度!
This commit is contained in:
33
入门/cli/hello-router/src/components/功能页面/路由守卫.vue
Normal file
33
入门/cli/hello-router/src/components/功能页面/路由守卫.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<!--
|
||||
* @Author: Kane
|
||||
* @Date: 2022-11-24 09:42:35
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2022-11-24 09:58:11
|
||||
* @FilePath: \hello-router\src\components\功能页面\路由守卫.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<h1>路由守卫</h1>
|
||||
<h1>{{ user.name }}</h1>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "route-guard",
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
name: "",
|
||||
age: 20,
|
||||
},
|
||||
};
|
||||
},
|
||||
beforeRouteUpdate(to) {
|
||||
alert(to.params.username);
|
||||
this.user.name = to.params.username;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
Reference in New Issue
Block a user