Skip to content

onShow

ts
import { definePage, onShow } from '@52css/mp-vue3'

definePage({
  queries: {},
  setup() {
    onShow(() => {
      console.log("🚀 ~ onShow ~ onShow:", onShow)
    })
  }
});

销毁

  • ✨ 返回函数,支持onHide销毁
ts
import { definePage, onShow } from '@52css/mp-vue3'

definePage({
  queries: {},
  setup() {
    onShow(() => {
      console.log('pageOnShow')
      return () => {
        console.log('pageOnHide')
      }
    })
  }
});