当前位置: 首页 > news >正文

柳州网络网站建设shopify网站建设

柳州网络网站建设,shopify网站建设,品牌建设与品牌推广,企业网站怎么做才好uniapp 微信小程序&#xff1a;页面组件的生命周期顺序 首页页面父组件子组件完整顺序参考资料 这个uniapp的微信小程序项目使用的是 VUE2 首页 首页只提供了一个跳转按钮。 <template><view><navigator url"/pages/myPage/myPage?namejerry" hov…

uniapp 微信小程序:页面+组件的生命周期顺序

  • 首页
  • 页面
  • 父组件
  • 子组件
  • 完整顺序
  • 参考资料

这个uniapp的微信小程序项目使用的是 VUE2

首页

首页只提供了一个跳转按钮。

<template><view><navigator url="/pages/myPage/myPage?name=jerry" hover-class="navigator-hover"><button type="default">跳转到新页面</button></navigator></view>
</template><script>export default {data() {return { }},}
</script><style>
</style>

页面

<template><view> 页面 <parent-component>parent-component</parent-component> </view>
</template><script>export default {data() {return { }},onInit(option){console.log(`页面 onInit: ${JSON.stringify(option)}`)},onLoad(option){console.log(`页面 onLoad: ${JSON.stringify(option)}`)},onShow(option){console.log(`页面 onShow: ${JSON.stringify(option)}`)},onReady(option){console.log(`页面 onReady: ${JSON.stringify(option)}`)},onHide(option){console.log(`页面 onHide: ${JSON.stringify(option)}`)},onUnload(option){console.log(`页面 onUnload: ${JSON.stringify(option)}`)},onResize(option){console.log(`页面 onResize: ${JSON.stringify(option)}`)},onPullDownRefresh(option){console.log(`页面 onPullDownRefresh: ${JSON.stringify(option)}`)},onReachBottom(option){console.log(`页面 onReachBottom: ${JSON.stringify(option)}`)},onTabItemTap(option){console.log(`页面 onTabItemTap: ${JSON.stringify(option)}`)},onShareAppMessage(option){console.log(`页面 onShareAppMessage: ${JSON.stringify(option)}`)},onPageScroll(option){console.log(`页面 onPageScroll: ${JSON.stringify(option)}`)},onShareTimeline(option){console.log(`页面 onShareTimeline: ${JSON.stringify(option)}`)},onAddToFavorites(option){console.log(`页面 onAddToFavorites: ${JSON.stringify(option)}`)},}
</script><style>
</style>

父组件

<template><view> 父组件 <child-component>child-component</child-component> </view>
</template><script>export default {data() {return {};},beforeCreate(option){console.log(`父组件 beforeCreate: ${option}`)},created(option){console.log(`父组件 created: ${option}`)},beforeMount(option){console.log(`父组件 beforeMount: ${option}`)},mounted(option){console.log(`父组件 mounted: ${option}`)},beforeDestroy(option){console.log(`父组件 beforeDestroy: ${option}`)},destroyed(option){console.log(`父组件 destroyed: ${option}`)},}
</script><style>
</style>

子组件

<template><view> 子组件 </view>
</template><script>export default {data() {return {};},beforeCreate(option){console.log(`子组件 beforeCreate: ${option}`)},created(option){console.log(`子组件 created: ${option}`)},beforeMount(option){console.log(`子组件 beforeMount: ${option}`)},mounted(option){console.log(`子组件 mounted: ${option}`)},beforeDestroy(option){console.log(`子组件 beforeDestroy: ${option}`)},destroyed(option){console.log(`子组件 destroyed: ${option}`)},}
</script><style>
</style>

完整顺序

在这里插入图片描述

// 进入
父组件 beforeCreate: undefined
父组件 created: undefined
父组件 beforeMount: undefined
子组件 beforeCreate: undefined
子组件 created: undefined
子组件 beforeMount: undefined
页面 onLoad: {"name":"jerry"}
页面 onShow: undefined
子组件 mounted: undefined
父组件 mounted: undefined
页面 onReady: undefined// 退出
页面 onUnload: undefined
子组件 beforeDestroy: undefined
子组件 destroyed: undefined
父组件 beforeDestroy: undefined
父组件 destroyed: undefined

参考资料

uniap 页面生命周期
uniapp 组件生命周期

http://www.yayakq.cn/news/837242/

相关文章:

  • 视频聚合网站怎么做不侵权上海网络推广服务
  • 网站建设及相关流程图建设管理部门网站查询
  • 延边网站建设公司微网站 杭州
  • 企业网站优化方案案例wordpress设计类模板
  • so域名的网站英国男女做那个视频网站
  • 广州易网网站建设wordpress嵌入外部网页
  • 建设企业网站前市场分析wordpress是什么平台
  • 网站备案怎么查询商丘住房和城乡建设网站
  • 设计中国展seo比较好的优化
  • 建网站的公司哪里好住房和城乡建设部官网证件查询注册
  • 重庆网站建站建设的费用笑傲网站建设
  • 建设厅网站修改密码济宁网站建设神华科技
  • 网站盗取图片山东省建设厅网站
  • dw网页设计制作网站的成品支付宝网站支付接口
  • 大连市营商环境建设监督局网站wordpress+企业站模版
  • 网站首页模板免费下载网络营销推广引流方法
  • 网站后台账号密码获取网络科技公司实习周记
  • 青岛建站软件一家只做家纺的网站
  • 网站建设优化托管app免费下载安装官方
  • 兼职做网站访问量和数据河南省住房和城乡建设厅电话
  • 潍坊市城乡建设局网站王占山军衔
  • logo是黑色 怎么调网站的色调科技网站设计公司排名
  • 手机门户网站开发wordpress不能启动怎么解决
  • 网站开发哪一种语言好重庆沙坪坝好玩的地方
  • 三明市网站建设做申诉资料网站
  • 网站建设和挂标情况清理表网页传奇公益服
  • 公司做完网站怎么搜不到在线平面设计软件免费版
  • 如何把做的网站发布到网上设计logo网站推荐
  • 多语言网站模板建网页软件
  • 做网站的保证承诺腾讯云服务器怎么登录