<template>
  <CusDialog
      title="流体高度"
      :show="show"
      @close="$emit('update:show', false)"
      @submit="$emit('update:show', false)"
      maxHeight="80%"
      :minHeight="min ? '500px' : 'unset'"
      :full="full"
  >
    <template #head>
      <div style="display: flex; align-items: center;">
        <CusFormColumn
            :span="12"
            link="switch"
            label="包含底部"
            v-model:param="full"
        />
        <CusFormColumn
            :span="12"
            link="switch"
            label="内容展开"
            v-model:param="expend"
        />
      </div>
    </template>
    <div>
      maxHeight百分比或px，非unset的时候生效<br/>
      maxHeight有值的前提下，可以设置最小高度<br/>
      <CusFormColumn
          :span="12"
          link="switch"
          label="最小高度500px"
          v-model:param="min"
      />
      <template v-if="expend">
        <template v-for="i in 100">
          {{i}}<br/>
        </template>
      </template>
    </div>
  </CusDialog>
</template>

<script lang="ts">
import {
  defineComponent,
  computed,
  onMounted,
  ref,
  reactive,
  watch,
  getCurrentInstance,
  ComponentInternalInstance,
  toRefs,
  nextTick
} from 'vue'
import {useStore} from 'vuex'
import {useRouter, useRoute} from 'vue-router'

export default defineComponent({
  name: '',
  components: {},
  props: {
    show: {}
  },
  setup(props, {emit}) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
    const state = reactive({
      full: false,
      expend: false,
      min: false
    })
    return {
      ...toRefs(state)
    }
  },
})
</script>

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