You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I would like to thank Vue's huge community for bringing great convenience to my development.
Well, starting from my scene, I want to use sfc playground to develop echarts charts, and hope that the echarts sample code will be displayed by default when the user opens the playground for the first time. But currently @vue/repl does not seem to directly support this scenario.
Here is some pseudocode.
// init storeconststore=newReplStore(...)// set echarts import mapstore.setImportMap({imports: {"echarts": "https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.esm.js","vue": "https://play.vuejs.org/vue.runtime.esm-browser.prod.js","vue/server-renderer": "https://play.vuejs.org/server-renderer.esm-browser.js"}})// todo: set welcome codestore.setFiles({'App.vue', welcomeRawCode})
If written like this, compileFile will be executed immediately inside the setFiles function. At this time, echarts library has not been loaded yet, and an error will be reported.
There is another way to complete the initialization through persistent url code, but if the welcome code changes frequently, the DX will be poor.
conststore=newReplStore({serializedState: urlCode,// If the welcome code template changes, this place needs to be regenerated.});
Expect
So, I would like to ask if @vue/repl can support welcomeCode and newSFCCode template customization, which can be provided through ReplStore initialization or a static method.
If PR is welcome, I can try to initiate one!😊
There is a PR.
The text was updated successfully, but these errors were encountered:
Situation
First of all, I would like to thank Vue's huge community for bringing great convenience to my development.
Well, starting from my scene, I want to use
sfc playground
to developecharts
charts, and hope that the echarts sample code will be displayed by default when the user opens the playground for the first time. But currently@vue/repl
does not seem to directly support this scenario.Here is some pseudocode.
If written like this,
compileFile
will be executed immediately inside the setFiles function. At this time, echarts library has not been loaded yet, and an error will be reported.There is another way to complete the initialization through persistent url code, but if the welcome code changes frequently, the DX will be poor.
Expect
So, I would like to ask if
@vue/repl
can supportwelcomeCode
andnewSFCCode
template customization, which can be provided through ReplStore initialization or a static method.If PR is welcome, I can try to initiate one!😊
There is a PR.
The text was updated successfully, but these errors were encountered: