<template>
    <view class="content">
        我是首页
    </view>
</template>

<script>
    export default {
        data() {
            return {
                title: 'Hello'
            }
        },
        // onLoad是页面初始化的时候 全局执行一次
        onLoad() {
            console.log('我是onLoad')
        },
        // onShow只要显示了该页面就会触发 全局执行多次
        onShow() {
            console.log('我是onShow')
        },
        // onHide只要离开当前页面就会触发 全局执行多次
        onHide() {
            console.log('我是onHide')
        },
        // onRead页面初次完成渲染是触发 全局一次
        onReady() {
            console.log('我是onReady')
        },
        methods: {

        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
</style>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案