Ssr
Introduction
Consideretions before you start using the SSR feature
Tho this feature is experimental, it is still very powerful, if you are souly using vue and vue-components imports, auto importing is not supported yet, and it will be a while till its supported.
- Render Single File Components from the server side.
- Auto import Components in your
emails
folder.
NOTE: For
Nuxt
it will always be theemails
folder for now, and for node, since you have the option to pick wich folder you wanna use, that will be your default folder to load components from.
- Importing files outside of the
emails
folder is not supported yet. - Importing 3th party libraries is not supported.
- Importing outside types or utils is not supported.
- Auto import vue imports (computed,ref....)
<script setup>
// Import what you need from vue.
import { computed, defineProps } from 'vue'
const props = defineProps({
name: String
})
const username = computed(() => props.name.toUpperCase())
</script>
<template>
<section>
<Layout>
<!-- Importing Components that lives inside the emails folder is supported -->
<h1>Welcome {{ username }}</h1>
</Layout>
</section>
</template>