@blueking/sub-saas
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-beta.9 • Public • Published

SAAS Iframe 访问分主系统(iframe 嵌入方),子系统(被嵌入方)

子系统使用

// router.js
import { rootPath, connectToMain } from '@blueking/sub-saas'
import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: rootPath,
    children: [
      {
        path: 'index',
        component: () => import("@view/index/index.vue")
      }
    ]
  }
]

const appRouter = createRouter({
  history: createWebHistory(),
  routes,
});

connectToMain(appRouter)
// main.js

import { createApp } from 'vue'
import { subEnv } from '@blueking/sub-saas'

import App from './app.vue';
import IframeApp from './iframe-app.vue';

createApp(subEnv ? IframeApp : App)
  .mount('#app');

主系统使用(SAAS url path 拼接 /sub/)

vue3

<template>
  <SubSaas src="http://xxx.job.com/sub" />
</template>
<script setup>
  import SubSaas from '@blueking/sub-saas/vue3'
</script>

vue2

<template>
  <SubSaas src="http://xxx.job.com/sub" />
</template>
<script setup>
  import SubSaas from '@blueking/sub-saas/vue2'
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i @blueking/sub-saas

Weekly Downloads

88

Version

0.0.0-beta.9

License

MIT

Unpacked Size

25.4 kB

Total Files

7

Last publish

Collaborators

  • blueking