@garfish/bridge-vue-v3
TypeScript icon, indicating that this package has built-in type declarations

1.17.6 • Public • Published

@garfish/bridge-vue-v3

NPM version

Vue bridge for vue v3 subapp. For more details, check here

Usage

// child app
import { vueBridge } from '@garfish/bridge-vue-v3';

function App() {
  return <div>content</div>;
}

export const provider = vueBridge({
  rootComponent: App,
  appOptions: ({ basename, dom, appName, props }) => {
    // pass the options to createApp. check hhttps://vuejs.org/api/application.html#createApp
    return {
      el: '#app',
      render: () => h(App),
    };
  },
  handleInstance: (vueInstance, { basename, dom, appName, props }) => {
    // you can do something in handleInstance after get the vueInstance
    vueInstance.use(newRouter(basename));
    vueInstance.provide(stateSymbol, createState());
  },
});

Contributing

Credit

  • single-spa for community raised a hot wave of micro front-end solutions, and we refer to the implementation of the bridge part in single-spa and we think it is a good design, so we fork the code of the bridge implementation part and make some adjustments for the lifecycles in Garfish.

/@garfish/bridge-vue-v3/

    Package Sidebar

    Install

    npm i @garfish/bridge-vue-v3

    Weekly Downloads

    8

    Version

    1.17.6

    License

    MIT

    Unpacked Size

    18 kB

    Total Files

    6

    Last publish

    Collaborators

    • reothues
    • aishiguang
    • cttrevor
    • shawzhou
    • jiadi0801
    • jsongo
    • rustle
    • zengkp