import { onLoad } from "@dcloudio/uni-app" onLoad(()=>{ console.log(11) })
从@dcloudio/uni-app
导出
可导出项:
formatAppLog formatH5Log getCurrentSubNVue getSsrGlobalData initUtsProxyClass initUtsProxyFunction onAddToFavorites onBackPress onError onHide onInit onLaunch onLoad onNavigationBarButtonTap onNavigationBarSearchInputChanged onNavigationBarSearchInputClicked onNavigationBarSearchInputConfirmed onNavigationBarSearchInputFocusChanged onPageNotFound onPageScroll onPullDownRefresh onReachBottom onReady onResize onSaveExitState onShareAppMessage onShareTimeline onShow onTabItemTap onThemeChange onUnhandledRejection onUnload requireNativePlugin resolveEasycom shallowSsrRef ssrRef
uniapp要用vue的语法来写,但是周期函数还是根据小程序内的周期函数来写 通过导出的配置项来看,可以直接使用周期函数