image.png
    A页面打开B页面,

    1. <template>
    2. <!--
    3. 1 自定义
    4. -->
    5. <view class="content">
    6. <image class="logo" src="/static/logo.png"></image>
    7. <view class="text-area">
    8. <text class="title">{{title}}</text>
    9. </view>
    10. </view>
    11. </template>
    12. <script>
    13. export default {
    14. data() {
    15. return {
    16. title: 'Hello'
    17. }
    18. },
    19. //页面加载
    20. onLoad() {
    21. console.log("page onLoad");
    22. },
    23. //页面渲染完成
    24. onReady() {
    25. console.log("page onReady");
    26. },
    27. //页面显示
    28. onShow() {
    29. console.log("page onShow");
    30. },
    31. //页面隐藏
    32. onHide() {
    33. console.log("page onHide");
    34. },
    35. //页面卸载
    36. onUnload() {
    37. console.log("page onUnload");
    38. },
    39. methods: {
    40. }
    41. }
    42. </script>
    43. <style>
    44. .content {
    45. display: flex;
    46. flex-direction: column;
    47. align-items: center;
    48. justify-content: center;
    49. }
    50. .logo {
    51. height: 200rpx;
    52. width: 200rpx;
    53. margin-top: 200rpx;
    54. margin-left: auto;
    55. margin-right: auto;
    56. margin-bottom: 50rpx;
    57. }
    58. .text-area {
    59. display: flex;
    60. justify-content: center;
    61. }
    62. .title {
    63. font-size: 36rpx;
    64. color: #8f8f94;
    65. }
    66. </style>