前端学习(2360):生命周期函数的学习
生活随笔
收集整理的這篇文章主要介紹了
前端学习(2360):生命周期函数的学习
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
app.vue
<script>export default {onLaunch: function() {console.log('App Launch')},onShow: function() {console.log('App Show')},onHide: function() {console.log('App Hide')},onError:function(err){console.log('出現異常',err)}} </script><style>/*每個頁面公共css */ </style>index.vue
<template><view class="content"><image class="logo" src="/static/logo.png"></image><view class="text-area"><text class="title">{{title}}</text></view></view> </template><script>export default {data() {return {title: 'Hello'}},onLoad(options) {console.log('頁面顯示了',options)},onShow(){console.log('頁面顯示了')}onReady() {console.log('準備中')}methods: {}} </script><style>.content {display: flex;flex-direction: column;align-items: center;justify-content: center;}.logo {height: 200rpx;width: 200rpx;margin-top: 200rpx;margin-left: auto;margin-right: auto;margin-bottom: 50rpx;}.text-area {display: flex;justify-content: center;}.title {font-size: 36rpx;color: #8f8f94;} </style>運行結果
總結
以上是生活随笔為你收集整理的前端学习(2360):生命周期函数的学习的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 浅析微信支付:商户平台开通现金红包、指定
- 下一篇: 前端学习/ Day1/HTTP简单易懂/