The problem of wepy components getting global globalData objects

at present, when Mini Program"s wepy framework component acquires a global globaldata object, it needs this.$parent.$parent;
. Is there any way to do function processing in a file, and which gloabaldata object can you directly go to when this function is returned?


get global globalData wepy.$instance.globalData
when do you need this.parent.parent

import wepy from 'wepy'
export const getGlobalData = function(){
    return wepy.$instance.globalData;
}
Menu