-
|
Hi all, I'm attempting to migrate our Handlbars-based email engine to use Maizzle 6.x but I'm running into an issue that I'm finding kind of maddening. It's not clear to me how to pass Vue props to a template that is being rendered. Here is what I am trying to do: In the execution layer: import { type MaizzleConfig, render } from "@maizzle/framework"
const config: MaizzleConfig = {
...maizzleConfig,
props: {
lang: "en",
},
}
const { html } = await render("templates/email/welcome.vue", config)In the sample template: <script setup lang="ts">
const props = defineProps({
lang: {
type: String,
required: true,
}
})
console.log("!!props", props)
const config = useConfig()
console.log("!!config", config)
</script>
<template>
<Html>
<Head />
<Body>
<Tailwind>
<Container class="bg-gray-100">
<Text class="text-lg text-gray-800">
Language is {{ lang }}
</Text>
</Container>
</Tailwind>
</Body>
</Html>
</template>
The console output is: and the template output is ...
<div style="margin: 0 auto; max-width: 600px; background-color: #f3f4f6;">
<p style="margin-top: 16px; font-size: 18px; line-height: 28px; color: #1f2937;">Language is</p>
</div>
...Please let me know what I'm doing wrong? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi, you're not doing anything wrong, that's just not possible right now with the Will add it in the next |
Beta Was this translation helpful? Give feedback.
-
|
Now available in v6.0.4, thanks for reporting it. |
Beta Was this translation helpful? Give feedback.
Now available in v6.0.4, thanks for reporting it.