This commit is contained in:
Alsmile 2020-11-11 18:20:08 +08:00
parent 2ee1891c95
commit 914781f4f8
1 changed files with 16 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="home">
<!-- 使用topology组件 -->
<topology :configs="topologyConfigs" :user="user" />
<topology :configs="topologyConfigs" :user="user" @event="onEvent" />
</div>
</template>
@ -73,8 +73,23 @@ export default {
{ name: "退出", action: "logout" },
],
},
user: {
username: "le5le",
},
};
},
methods: {
onEvent(e) {
switch (e.name) {
case "logout":
this.user = null;
// Do sth.
break;
// ...
// ...
}
},
},
};
</script>
<style lang="scss">