Skip to content

Instantly share code, notes, and snippets.

@Idered
Created March 7, 2022 12:45
Show Gist options
  • Save Idered/31be8ea5bf2f033ebb07c2a3ea2a8ba0 to your computer and use it in GitHub Desktop.
Save Idered/31be8ea5bf2f033ebb07c2a3ea2a8ba0 to your computer and use it in GitHub Desktop.
<template>
<slot :env="env" />
</template>
<script setup lang="ts">
const env = computed(() =>
Object.entries(import.meta.env).reduce(
(acc, [key, value]) => ({
...acc,
[key]: value,
}),
{} as ImportMetaEnv,
),
)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment