-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy pathLayout.vue
More file actions
57 lines (54 loc) · 1.28 KB
/
Layout.vue
File metadata and controls
57 lines (54 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
<Content />
<Button />
<UnusedButton />
<hr />
<home-images />
<home-content />
<home-button />
<hr />
<css-modules-button />
<hr />
<common-lib-element />
<common-lib-counter />
<hr />
<div ref="container"></div>
<hr />
<dynamic-images />
<dynamic-content />
<!-- <dynamic-button /> -->
</template>
<script>
import Content from "./components/Content.vue";
import Button from "./components/Button.js";
import UnusedButton from "./components/UnusedButton.vue";
import { render,h } from 'vue'
import {__federation_method_setRemote, __federation_method_getRemote, __federation_method_unwrapDefault} from 'virtual:__federation__'
export default { components: {
Content,
Button,
UnusedButton,
},
mounted(){
__federation_method_setRemote('dynamic', {url:()=>Promise.resolve('http://localhost:5004/assets/remoteEntry.js'),format:'esm',from:'vite'});
__federation_method_getRemote('dynamic','./Button')
.then(moduleWraped=>__federation_method_unwrapDefault(moduleWraped))
.then(module=>{
render(h(module,{}),this.$refs.container)
})
}
};
</script>
<style scoped>
img {
width: 200px;
}
.h1 {
border: 5px solid red !important;
padding: 1px !important;
}
.section {
border: 1px solid black;
padding: 10px;
}
</style>