Closed YangTingTing-tech closed 10 months ago
here is the wrong message in chrome console:
I had run into the same issue. It's a bit wonky, but I was able to solve it like so:
const store = new ReplStore();
store.setImportMap({
imports: {
myLib: "myLib"
}
});
const previewOptions = {
headHTML: '<link rel="stylesheet" href="/myLib.css">',
customCode: {
importCode: `import myLib from 'myLib'`,
useCode: `app.use(myLib)`
}
};
const defaultFiles = store.getFiles();
delete defaultFiles["App.vue"];
store.setFiles({ ...defaultFiles, "myDefaultComponent.vue": myDefaultComponent}, "myDefaultComponent.vue");
We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.
I use @vue/reply in vitepress to show my UI demo, but it doesn't work to setImportMap. The wrong Message in iframe is "Failed to resolve module specifier "dayjs". Tip: edit the "Import Map" tab to specify import paths for dependencies." There already exist a imports about 'element-plus' in Import Map, like this:
Here is my code in a .vue file.