Skip to content

onLoad

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

definePage({
  queries: {},
  setup() {
    onLoad((queryRecord<string, string | undefined>) => {
      console.log("🚀 ~ onLoad ~ query:", query)
    })
  }
});

销毁

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

definePage({
  queries: {},
  setup() {
    onLoad(() => {
      console.log('pageOnLoad')
      return () => {
        console.log('pageOnUnload')
      }
    })
  }
});