Skip to content

feat: ionic vue lifecycle hook functions #22440

@AlwaysLoveme

Description

@AlwaysLoveme

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request
i want to use lifecycle "ionViewWillEnter" width vue3 composition api in setup function, but there is no method,

Describe Preferred Solution

Describe Alternatives

Related Code

<script lang="ts">
import Goods from '@/api/goods';
import {useRouter, useRoute} from "vue-router";
// import {getInstance} from "@/utils/getInstance";
import {effect, reactive} from '@vue/reactivity'
import {defineComponent, onMounted, ref, watch} from "vue";
import {
  IonPage,
  IonList,
  IonItem,
  IonLabel,
  IonAvatar,
} from '@ionic/vue';

export default defineComponent({
  name: "GoodsList",
  components: {
    IonPage,
    IonList,
    IonItem,
    IonAvatar,
    IonLabel,
  },
  methods: {
    // only use like this
    ionViewWillEnter() {
      console.log('Home page will enter');
    }
  },
  setup() {
      onMounted(() => {
      })
      // i hope to use on here, eg:
     ionViewWillEnter(() => {})
  }
})
</script>

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions