I am creating a playground for library documentation using VuePress theme Hope in Markdown file. I am following the documentation here, but I am unable to use it with custom HTML that includes CDN link and uses of function from CDN file. I know Sandpack supports static files as shown here but I am unsure how to do it inside VuePress markdown files.
Here are the contents of the CDN link for clarity:
function renderH1(text) {
var h1 = document.createElement('h1');
h1.textContent = text;
return h1;
}
My question is: How exactly can I edit the code below so everything works with custom HTML and JS files without using Vue template?
What should I replace these lines with?
::: sandpack#vue Vue Demo
@file /src/App.vue
Here is the entire code.
Note: the slashes at the beginning of the next-to-last line aren’t there. I added them so Stack Overflow accepts the code block formatting.
::: sandpack#vue Vue Demo
@file /src/App.vue
```html
<script src="https://temp.staticsave.com/666f2f346eb37.js">
<script>
let res = renderH1("L");
document.body.appendChild(res);
</script>
<div id="res"></div>
// ```
:::
Thanks!