How do I consume eleventy-fetch data in my Lit components? #2653
Unanswered
bossanovaorca
asked this question in
Q&A
Replies: 1 comment
-
|
with the help of bennyp in Discord: using an inline script and running the data through a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am building a site with Lit web components and 11ty, and I would like make a request with eleventy-fetch to feed data into my component. I've tried a few approaches to this, but I am unable to import the cached data in my component. The errors all seem to revolve around lack of default imports/exports in
eleventy-fetch. Can anyone help me with this issue?11ty JS data file:
web component file:
using an inline script seems like a workaround in this situation since my JSON data gets fed through an HTML parser before I can interact with it in the template. Is there some way to directly import 11ty data files in my component JS/TS?
Beta Was this translation helpful? Give feedback.
All reactions