fix: fixed demos
This commit is contained in:
parent
5af3c24248
commit
890cd49895
3 changed files with 15 additions and 6 deletions
|
|
@ -19,12 +19,15 @@ if (!entry) {
|
||||||
}
|
}
|
||||||
const { remarkPluginFrontmatter } = await render(entry);
|
const { remarkPluginFrontmatter } = await render(entry);
|
||||||
|
|
||||||
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
|
const loadDemoAttributes = {};
|
||||||
|
if (remarkPluginFrontmatter.mdjsStoriesPath) {
|
||||||
|
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
|
||||||
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<InPageNavLayout entry={entry}>
|
<InPageNavLayout entry={entry}>
|
||||||
<load-demo ?data-import-path={importPath}></load-demo>
|
<load-demo {...loadDemoAttributes}></load-demo>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class LoadDemo extends HTMLElement {
|
class LoadDemo extends HTMLElement {
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,15 @@ if (!entry) {
|
||||||
}
|
}
|
||||||
const { remarkPluginFrontmatter } = await render(entry);
|
const { remarkPluginFrontmatter } = await render(entry);
|
||||||
|
|
||||||
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
|
const loadDemoAttributes = {};
|
||||||
|
if (remarkPluginFrontmatter.mdjsStoriesPath) {
|
||||||
|
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
|
||||||
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<InPageNavLayout entry={entry}>
|
<InPageNavLayout entry={entry}>
|
||||||
<load-demo ?data-import-path={importPath}></load-demo>
|
<load-demo {...loadDemoAttributes}></load-demo>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class LoadDemo extends HTMLElement {
|
class LoadDemo extends HTMLElement {
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,14 @@ if (!entry) {
|
||||||
}
|
}
|
||||||
const { remarkPluginFrontmatter } = await render(entry);
|
const { remarkPluginFrontmatter } = await render(entry);
|
||||||
|
|
||||||
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
|
const loadDemoAttributes = {};
|
||||||
|
if (remarkPluginFrontmatter.mdjsStoriesPath) {
|
||||||
|
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
|
||||||
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<InPageNavLayout entry={entry}>
|
<InPageNavLayout entry={entry}>
|
||||||
<load-demo ?data-import-path={importPath}></load-demo>
|
<load-demo {...loadDemoAttributes}></load-demo>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class LoadDemo extends HTMLElement {
|
class LoadDemo extends HTMLElement {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue