发布全局的栏目订阅

            that.$emitter.emit('on-menu-user', that.menuUser);
            that.$emitter.emit('on-menu-right', that.menuRight);
            that.$emitter.emit('on-menu-footer', that.menuFooter);
            that.$emitter.emit('on-menu-content', that.menuContent);
            that.$emitter.emit('on-menu-data', that.menuT);
            that.$emitter.emit('on-menu-group-data', that.menuT);
            that.$emitter.emit('on-menu-tree-data', menuTree);

import mainContentNav from "@/components/basis/main-content-nav/method";

订阅栏目消息

 that.$emitter.on('on-menu-data', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-content', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-footer', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-right', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-user', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-group-data', (data, e) => {
            console.log(data);
        });
  that.$emitter.on('on-menu-tree-data', (data, e) => {
            console.log(data);
        });

on-menu-tree-data 数据结构

import { listConvertTree } from "@/utils/fn-tree-common-tree-to-list";
let menuTree = listConvertTree(menuT, true, true);

发布全局的栏目订阅

            that.$emitter.emit('on-menu-user', that.menuUser);
            that.$emitter.emit('on-menu-right', that.menuRight);
            that.$emitter.emit('on-menu-footer', that.menuFooter);
            that.$emitter.emit('on-menu-content', that.menuContent);
            that.$emitter.emit('on-menu-topic', that.menuTopic);
            that.$emitter.emit('on-menu-quick', that.menuQuick);
            that.$emitter.emit('on-menu-data', menuT);
            that.$emitter.emit('on-menu-logout', that.menuLogout);
            that.$emitter.emit('on-menu-my-user', that.menuMyUser);
            that.$emitter.emit('on-menu-sys-chat', that.menuChat);
            that.$emitter.emit('on-menu-sys-notice', that.menuNotice);
            that.$emitter.emit('on-menu-recommend', that.menuRecommend);
            that.$emitter.emit('on-menu-tree-data', that.menuTree);

            that.$emitter.emit('on-menu-all-data', {
                data: menuTree, //栏目树形结构数据
                recommend: menuRecommend, //栏目推荐
                menus: menuT, //栏目列表结构数据
                myUser: menuMyUserT, //个人信息
                topic: that.menuTopic, //专题推荐
                quick: that.menuQuick, //快捷方式
                notice: menuNoticeT, //站内通知
                chat: menuChatT, //站内消息
                logout: menuLogoutT //退出
            });
文档更新时间: 2021-09-28 07:53   作者:admin