-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hubert
committed
Jan 7, 2025
1 parent
9f48082
commit e35cfae
Showing
19 changed files
with
2,487 additions
and
1,733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
packages/module-loader/playground/pages/remote-component-page.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,16 @@ import { defineNuxtConfig } from 'nuxt/config'; | |
|
||
export default defineNuxtConfig({ | ||
ssr: false, | ||
srcDir: 'src/', | ||
app: { | ||
head: { | ||
script: [{ src: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js-loading-overlay.min.js' }], | ||
}, | ||
}, | ||
// plugins: [{ src: 'plugins/module-loader' }], | ||
build: { | ||
transpile: ['@vue-async/*'], | ||
}, | ||
alias: { | ||
'@vue-async/module-loader': fileURLToPath(new URL('../src', import.meta.url)), | ||
'@vue-async/module-loader': fileURLToPath(new URL('../packages/module-loader/src', import.meta.url)), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@test/playground", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"serve": "nuxt dev -p 7001" | ||
}, | ||
"dependencies": { | ||
"nuxt": "^3.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div> | ||
<NuxtLayout> | ||
<NuxtPage/> | ||
</NuxtLayout> | ||
</div> | ||
</template> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div> | ||
<h3>这是使用 registerComponents 在页面动态加载远程组件。</h3> | ||
<AsyncComponent /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { defineAsyncComponent } from 'vue-demi'; | ||
import { registerComponents } from '@vue-async/module-loader'; | ||
const useRemoteComponents = registerComponents({ | ||
componentA: { | ||
src: 'http://localhost:7010/componentA/index.umd.js', | ||
styles: 'http://localhost:7010/componentA/style.css', | ||
}, | ||
}); | ||
const AsyncComponent = defineAsyncComponent(() => { | ||
const remoteComponents = useRemoteComponents(); | ||
return remoteComponents.componentA(); | ||
}); | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
h3 { | ||
color: blue; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.