Skip to content

Is there a way too create a base component? #64

@bitfactory-michel-lubbers

Description

I have installed this package as is in a project.
And i saw too create a email you need to write the css and layout in every template.

I was not able to find how to import a custom component inside the email template.
When i tried i got the following error

[Vue warn]: Failed to resolve component: EmailLayout
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

Filestructuur:

  • components
    -- EmailLayout.vue failed in loading
  • emails
    -- EmailTemplate.vue
    -- EmailLayout.vue failed in loading

email - layout

<template>
    <EHtml :lang="lang">
        <slot />
    </EHtml>
</template>

<script lang="ts" setup>
import { defineComponent } from 'vue';
import { EHtml } from 'vue-email';

export default defineComponent({
    name: 'EmailLayout',
    props: {
        lang: {
            type: String,
            default: 'en',
        },
    },
})
</script>

email - template

<template>
    <EmailLayout>
        <e-button :href="url">View on GitHub</e-button>
    </EmailLayout>
</template>

<script lang="ts" setup>
defineProps<{ url: string }>();
</script>

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions