@vuebro/loader-sfc 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Vue SFC Loader
2
+
3
+ Single File Component loader for Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
4
+
5
+ ## Installation
6
+
7
+ Install @vuebro/loader-sfc with npm
8
+
9
+ ```bash
10
+ npm install @vuebro/loader-sfc
11
+ ```
12
+
13
+ ## Usage/Examples
14
+
15
+ [Documentation oт Async Components](https://vuejs.org/guide/components/async)
16
+
17
+ To load .vue files dynamically at runtime just use loadModule function:
18
+
19
+ ```javascript
20
+ <script setup>
21
+ import { defineAsyncComponent } from "vue";
22
+ import loadModule from "@vuebro/loader-sfc";
23
+
24
+ const AdminPage = defineAsyncComponent(() =>
25
+ loadModule('./components/AdminPageComponent.vue')
26
+ );
27
+ </script>
28
+
29
+ <template>
30
+ <AdminPage />
31
+ </template>
32
+ ```
@@ -0,0 +1,2 @@
1
+ declare const loadModule: (filename: string) => Promise<Record<string, string | object>>;
2
+ export default loadModule;