import{isPage,instances,initRelation}from'./util'importparseBasePagefrom'../../../mp-weixin/runtime/wrapper/page-base-parser'exportdefaultfunctionparsePage(vuePageOptions){constpageOptions=parseBasePage(vuePageOptions,{isPage,initRelation})// 页面需要在 ready 中触发,其他组件是在 handleLink 中触发pageOptions.lifetimes.ready=functionready(){if(this.$vm&&this.$vm.mpType==='page'){this.$vm.__call_hook('created')this.$vm.__call_hook('beforeMount')this.$vm._isMounted=truethis.$vm.__call_hook('mounted')this.$vm.__call_hook('onReady')}else{this.is&&console.warn(this.is+' is not ready')}}pageOptions.lifetimes.detached=functiondetached(){this.$vm&&this.$vm.$destroy()// 清理constpageId=this.pageinstance.__pageId__Object.keys(instances).forEach(key=>{if(key.indexOf(pageId+'_')===0){deleteinstances[key]}})}returnpageOptions}