<template>
  <PageWrapper dense >
    <VFormDesign :saveClick="visible" />
  </PageWrapper>
</template>

<script lang="ts">
  import { defineComponent, watch,toRefs,reactive } from 'vue';
  import { PageWrapper } from '@/components/Page';
  import VFormDesign from './components/VFormDesign/index.vue';

  export default defineComponent({
    name: 'FormDesign',
    components: {
      PageWrapper,
      VFormDesign,
    },
    props: ['isSubmitClick'],
    setup(_props, { emit }) {
      const state = reactive<{
        visible: boolean
      }>({
        visible: false 
      });

      watch(()=>_props.isSubmitClick,(newValue,oldValue)=>{
         state.visible = newValue
         setTimeout(()=>{
          emit('designformback')
         },1000)
         
      },{immediate:true,deep:true})

      return { ...toRefs(state) };
    }
  })
  

</script>

<style lang="less" scoped></style>
