@vuebro/loader-sfc 2.3.34 → 2.4.0

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 CHANGED
@@ -41,8 +41,8 @@ To load .vue files dynamically at runtime just use the `loadModule` function:
41
41
  import { defineAsyncComponent } from "vue";
42
42
  import loadModule from "@vuebro/loader-sfc";
43
43
 
44
- const AdminPage = defineAsyncComponent(() =>
45
- loadModule("./components/AdminPageComponent.vue"),
44
+ const AdminPage = defineAsyncComponent(async () =>
45
+ loadModule(await (await fetch("./components/AdminPageComponent.vue")).text()),
46
46
  );
47
47
  </script>
48
48
 
@@ -59,8 +59,8 @@ You can pass configuration options to customize the compilation process:
59
59
  import { defineAsyncComponent } from "vue";
60
60
  import loadModule from "@vuebro/loader-sfc";
61
61
 
62
- const MyComponent = defineAsyncComponent(() =>
63
- loadModule("./components/MyComponent.vue", {
62
+ const MyComponent = defineAsyncComponent(async () =>
63
+ loadModule(await (await fetch("./components/MyComponent.vue")).text(), {
64
64
  scriptOptions: {
65
65
  templateOptions: {
66
66
  compilerOptions: {
@@ -1,4 +1,4 @@
1
- import type { SFCAsyncStyleCompileOptions, SFCParseOptions, SFCScriptCompileOptions } from "vue/compiler-sfc";
1
+ import type { SFCAsyncStyleCompileOptions, SFCParseOptions, SFCScriptCompileOptions } from "@vue/compiler-sfc";
2
2
  declare const _default: (sfc: string, { parseOptions, scriptOptions: { templateOptions: { compilerOptions: { expressionPlugins, ...restCompilerOptions }, ...restTemplateOptions }, ...restScriptOptions }, styleOptions, }?: undefined | {
3
3
  parseOptions?: Partial<SFCParseOptions>;
4
4
  scriptOptions?: Partial<SFCScriptCompileOptions>;