parsajiravand / vue3-form-wizard

A vue3 based tab/form wizard
https://vue3-form-wizard-document.netlify.app/
31 stars 8 forks source link

lazy load not working #18

Open kauenzo opened 1 year ago

kauenzo commented 1 year ago

All my components are mounted when i start the app. Is possible to fix lazy load? Because i don't want the onMounted propriety to be executed when i start my app. There was the same issue in the legacy form-wizard, #356 and #377

<template>
  <div>
    <form-wizard @onComplete="onComplete">
      <tab-content :lazy="true">
        <FirstStep message="step content 1" />
      </tab-content>
      <tab-content :lazy="false">
        <SecondStep message="step content 2" />
      </tab-content>
      <tab-content> finally </tab-content>
    </form-wizard>
  </div>
</template>
<script setup>
import { defineProps, onMounted } from 'vue'
defineProps({
  message: String
})

onMounted(() => {
  console.log('mounted first step')
})
</script>
parsajiravand commented 1 year ago

@kauenzo Thanks for your report . i will check this issue.

If you explain more it can help alot. Do you want render WizardStep component and lazyload TabContent component or both of them hide when you set lazy?

kauenzo commented 1 year ago

@parsajiravand I want to render tabContent components only when it has in its index. Actualy, all components are mounted when app is start, this makes the onMounted property to be executed in start