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
Copy file name to clipboardExpand all lines: README.md
+41-24Lines changed: 41 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,16 +52,15 @@ To render a component preview, use the `<ComponentPreviewArea />` component in y
52
52
</template>
53
53
```
54
54
55
-
### Using the App Loader (Recommended)
55
+
### Using the App Loader
56
56
57
-
The simplest way to enable component preview in an external HTML page is using the app-loader script. This single script automatically handles all the setup:
57
+
The app-loader script automatically sets up everything needed for component preview:
@@ -85,33 +88,47 @@ The simplest way to enable component preview in an external HTML page is using t
85
88
</html>
86
89
```
87
90
88
-
The app-loader script automatically:
89
-
- Creates the necessary DOM containers (`#__nuxt` and `#teleports`)
90
-
- Sets up the runtime configuration with `componentPreview: true`
91
-
- Loads the Nuxt entry module
92
-
- Fires the `nuxt-component-preview:ready` event when ready
91
+
See [playground/public/preview-test-loader.html](./playground/public/preview-test-loader.html) for a working example.
93
92
94
-
See [playground/public/preview-test-loader.html](./playground/public/preview-test-loader.html) for a complete working example.
93
+
### API Reference
95
94
96
-
This setup is ideal for integrating with a Drupal backend (or any backend) that needs to render Nuxt components in isolation, such as for CMS previews or design systems.
95
+
#### `nuxt-component-preview:ready` Event
97
96
98
-
### API Reference
97
+
Fired when the Nuxt app is ready for component preview:
0 commit comments