MorJS 扩展能力使用
在 MorJS 中默认集成了 contextPlugin 以及 eventPlugin 插件,因此在 getApp() 上,默认会挂载有 $context 及 $event 的属性
import { aPage } from '@morjs/core'
aPage({
onLoad() {
const { appQuery } = getApp().$context
console.log('app.js 的 onLaunch 中的全局参数:', appQuery)
const { all, emit, off, on, once } = getApp().$event
// 全局事件支持,提供 emit, off, on, once 方法进行绑定
}
})