#父路由页面#
<template>
<div style="height: 100%">
<!-- 路由占位符 -->
<router-view @update="getRightList()" />
</div>
</template>
<script>
export default {
name: "Home",
data() {
return {
}
},
methods: {
// 获取权限数据
getRightList(data) {
console.log("45465456");
},
},
}
<script>
#子路由页面#
let _that = this;
_that.$emit("update");
本文介绍了一个使用Vue.js实现的父路由与子路由页面间的通信案例。通过自定义事件更新子组件状态,展示了如何在Vue项目中组织结构化的路由布局,并实现组件间的有效通信。
3858

被折叠的 条评论
为什么被折叠?



