<script lang="ts">
import { computed, defineComponent, inject } from 'vue'
import type { LeapConfig } from '@ldesign/business-next'
import { useConfigStore } from '@ldesign/business-next'

export default defineComponent({
  setup() {
    const $config = inject<LeapConfig>('$config', {} as LeapConfig)

    const leapConfig = computed(() => $config.getLeapConfig())
    const appConfig = computed(() => $config.getAppConfig())

    const { $setInfo } = useConfigStore()
    // 测试store存储
    $setInfo('000')
    return {
      leapConfig,
      appConfig,
    }
  },
})
</script>

<template>
  <l-config-provider>
    <router-view
      :leap-config="leapConfig"
      :app-config="appConfig"
    />
  </l-config-provider>
</template>

<style lang="less">
html,body {
  height: 100%;
  margin: 0;
  & > #app {
    height: 100%;
  }
}
</style>
