1.I didn't delete the old playground in the project, and I temporarily put the new playground in the play folder. I think how to manage it needs to be discussed. Usually when developing components, we need an environment that can hot update the code for us to debug. The old playground is satisfied, and the new playground is based on vue-repl
, which can set different dependency versions. It is pulled from cdn
, so it is If it does not meet the needs of our development (I don't know if there is a better way to make it compatible), it usually exists as a feedback issue to provide minimal reproduction.
2.The CDN used are free from abroad, so the access will be delayed a little.
3.In vue-repl
, the dependencies are pulled from cdn
, which is isolated from the dependencies and styles of the upper-level project, which requires that the dependencies can be run directly on the browser, although unocss
provides the ability to run directly on the browser. Running runtime
, but it seems that some preset plugins cannot be run, such as the icon component of onu-ui
depends on. Of course, unocss
may have other ways that I don't know. So here I send the node rendered by the iframe
to the upper-level project through postMessage
, use unocss
to compile the css
information and send it back, so as to realize the normal display of the icon. But this process adds cdn
time, so it will be slower when it is first opened.
- At present
welcome.vue
has written more components, which can be simplified later.
1.项目中旧的 playground 我没有删除,而新的 playground 我暂时放在了 play 文件夹内,如何管理我认为是需要讨论的。通常在开发组件时,我们需要一个环境能够热更新代码供我们调试,这一点旧 playground 是满足的,而新 playground 基于 vue-repl,可以设置不同依赖版本,它是从 cdn 拉取的所以它是不满足我们开发时的需求的(不知道有没有更好的办法做兼容),通常作为反馈 issun 时提供最小复现而存在的。
2.使用的 cdn 均为国外免费的,所以访问上会延迟一点。
3.在 vue-repl 中依赖是从 cdn 拉取的,与上层项目的依赖、样式都有隔离,这要求依赖可以直接在浏览器上运行,尽管 unocss 提供了可以直接在浏览器运行的 runtime,但是似乎对一些预设插件,无法运行,比如图标依赖,当然 unocss可能有其他方式是我不知道的,所以这里我用 postMessag,将 iframe 渲染的节点发送到上层项目,使用 unocss 编译出 css 信息后再发送回去,实现了图标的正常显示。但是这个过程 加上 cdn 时间,所以在初次打开时会比较慢。
- 目前模板里welcome.vue 写了比较多的组件,后期可以考虑简化.
.... 总之,先有一版吧 😂