@redneckz/microfront-core-vue2
Microfrontend Core Library for Vue 2
Installation
$ npm install --save @redneckz/microfront-core @redneckz/microfront-core-vue2 @vue/composition-api
or:
$ yarn add @redneckz/microfront-core @redneckz/microfront-core-vue2 @vue/composition-api
Usage
// Isolation setup (including Zone.js)
import '@redneckz/microfront-core/lib/configure';
import Vue from 'vue';
import VueCompositionAPI from '@vue/composition-api';
import microfront from '@redneckz/microfront-core-vue2';
import App from './App.vue';
Vue.use(VueCompositionAPI).use(microfront);
new Vue({
el: '#app',
components: { App }
});
<template>
<MicroFrontContainer :bootstrap="bootstrapFoo">
<div ref="mountingRoot">Loading...</div>
</MicroFrontContainer>
</template>
<script lang="ts">
import Vue from 'vue';
import { register } from '@redneckz/microfront-core';
import { MicroFrontContainer } from '@redneckz/microfront-core-vue2';
const bootstrapFoo = register(
'foo', // remote module name according to Module Federation config
() => import('foo/module') // remote module
);
export default Vue.extend({
name: 'App',
components: { MicroFrontContainer },
methods: { bootstrapFoo }
});
</script>