[solved] which file is the Mini Program global object of mpvue configured in?

Business background

mpvue developer Mini Program
wants to get global globalData

on the page.

perplexed

it is not directly stated in the official documentation
that this attribute is not found in App.vue and main.js files in the src directory.
now I"m out of my mind, thinking about Rest. So now I don"t know how to solve it with my own ability

question

Please tell me ~ Thank you

Mar.02,2021

this is a pseudo requirement
what I originally meant was:

  • define some global variables and methods in the global object
  • then share this data on various sub-pages to manipulate

in fact, in each sub-page, the direct operation is the same by getting the global object. There is no need to set..


at the entry main.js, after mounting the node, add one more thing:
Vue.prototype.globalData = getApp (). GlobalData.
this way you can get global variables for each instantiated object.
the second way is to use vuex

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4547b-442ab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4547b-442ab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?