Open InfernalAzazel opened 1 month ago
@InfernalAzazel
There are two problems:
global demo defaultPreviewMode invalid
The problem has fixed in version 0.0.3, by "pnpm upgrade @sgwm-sutras/plugin@0.0.3"
global components not working in browser mode
browser mode uses sandbox isolation to run your demo independently in the sandbox, but the sandbox does not inherit globally registered components.
Having sandboxes inherit globally registered components is something I think is necessary, and I intend to start implementing it
@InfernalAzazel
There are two problems:
global demo defaultPreviewMode invalid
The problem has fixed in version 0.0.3, by "pnpm upgrade @sgwm-sutras/plugin@0.0.3"
global components not working in browser mode
browser mode uses sandbox isolation to run your demo independently in the sandbox, but the sandbox does not inherit globally registered components.
Having sandboxes inherit globally registered components is something I think is necessary, and I intend to start implementing it
Great!
@InfernalAzazel
I personally recommend that you import components directly into the demo for the following reasons:
Global import will cause users to load all the components in Navie and NaviePro at once when they first visit your website, causing the website to open slowly.
For your document learners, they will use your components according to your demo, so they will also get better performance.
And how the components are loaded is more intuitive to some beginners.
However, I still plan to implement global registration and resolve the performance issues so that your component library supports learners to load on-demand through plug-ins such as unplugin-components-vue.
It is recommended that you write the document by [direct introduction](https://www.naiveui.com/en-US/os-theme/docs/usage-sfc#Import-Directly-(Recommended) first
@InfernalAzazel
I personally recommend that you import components directly into the demo for the following reasons:
- Global imports may affect document performance, although the impact is minor.
Global import will cause users to load all the components in Navie and NaviePro at once when they first visit your website, causing the website to open slowly.
- The components imported directly in the demo will only be loaded when the relevant documents are opened by the user, so there is better performance, that is, the so-called on-demand loading.
For your document learners, they will use your components according to your demo, so they will also get better performance.
And how the components are loaded is more intuitive to some beginners.
However, I still plan to implement global registration and resolve the performance issues so that your component library supports learners to load on-demand through plug-ins such as unplugin-components-vue.
It is recommended that you write the document by [direct introduction](https://www.naiveui.com/en-US/os-theme/docs/usage-sfc#Import-Directly-(Recommended) first
Thank you for your valuable feedback. The specific specifications for Naive Pro Components are still being finalized, but I want to keep them as simple as possible and allow the vast majority of people to understand the component code and potentially participate in PR. As for on-demand introduction, I need to learn some and achieve it while maintaining the Vue code style. I will not use TS TSX temporarily.
Online Display
naive-pro-components
Reproduction Code
ProLayout.md DemoLayout.vue config.ts
Dependencies
Operating System
Browser
Google Chrome 版本 124.0.6367.78(正式版本)(64 位)