@blueking/sub-saas

蓝鲸 SAAS 作为子系统访问
15,627
Install
npm install @blueking/sub-saas
Latest Version:0.0.0-beta.9
Vue:3
License:MIT
Last Updated:May 24, 2024
Links: npm
Maintainer: blueking-magicbox

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>

Related Packages

@blueking/table

蓝鲸 Table

8,037
@blueking/functional-dependency

蓝鲸通用功能依赖展示

6,698
@blueking/bkflow-canvas-editor-vue2

Vue 2.7 适配层,在 Vue 2 项目中使用 @blueking/bkflow-canvas-editor(内置 Vue 3...

6,227

Version History

Pre-releases (9)
Version Released Vue License
0.0.0-beta.9 ^3.4.21 MIT
0.0.0-beta.8 ^3.4.21 MIT
0.0.0-beta.7 ^3.4.21 MIT
0.0.0-beta.6 ^3.4.21 MIT
0.0.0-beta.5 ^3.4.21 MIT