Content-Length: 280706 | pFad | https://github.com/vue-email/vue-email/commit/cb78b7b

F5 feat: add components use (#170) · vue-email/vue-email@cb78b7b · GitHub
Skip to content

Commit cb78b7b

Browse files
authored
feat: add components use (#170)
1 parent b462be6 commit cb78b7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/composables/render.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface Options {
1313
export interface RenderParams {
1414
props?: any
1515
i18n?: I18n
16+
components?: Record<string, Component>
1617
}
1718

1819
async function useI18n(app: App, params?: RenderParams | null) {
@@ -71,6 +72,11 @@ export async function useRender(
7172
const doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
7273
const app = createApp({ render: () => h(component) }, params?.props)
7374

75+
if (params?.components) {
76+
for (const [name, component] of Object.entries(params.components))
77+
app.component(name, component)
78+
}
79+
7480
app.config.globalProperties.$vueEmail = config
7581

7682
await useI18n(app, params)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/vue-email/vue-email/commit/cb78b7b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy