James Smith
James Smith

Reputation: 11

Is it possible to pass through a Vue component via Mustache syntax {{}}?

I have a markdown file with YAML frontmatter. In the frontmatter, I want to refer to a component such as:

---
title: Hello world
component: <component-a></component-a>
---
Lorem ipsum...

I want to refer to this in the vue file via {{page.component}}. Is there a way to have vue recognize this? Right now, it just spits out , instead of the actual component. If it helps, I am using Nuxt.

Upvotes: 1

Views: 121

Answers (1)

Boussadjra Brahim
Boussadjra Brahim

Reputation: 1

Try to use component to render it like :

 <component :is="page.component" />

Upvotes: 1

Related Questions