npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@das-fed/mframe

v0.0.37

Published

总体接入步骤 1. 安装@das-fed/mframe 2. 修改单页应用的挂载点

Readme

子应用接入步骤

总体接入步骤

  1. 安装@das-fed/mframe
  2. 修改单页应用的挂载点

完成以上步骤即可完成接入。

1. 安装@das-fed/mframe

pnpm add @das-fed/mframe

2. 修改SPA应用的挂载点

2.1 子应用是vue时

原应用的mian.ts代码最小化代码假设如下:

import { createApp } from 'vue'
import { router } from './router'
import App from './App.vue'

const app = createApp(App)
app.use(router)
app.mount('#app')

需要改为:

import { createApp } from 'vue'
import { router } from './router'
import App from './App.vue'
import { createMicroApp } from '@das-fed/mframe' // 引入框架依赖

const app = createApp(App)
app.use(router)

// 使用mframe创建子应用,并修改原spa应用的挂载点
createMicroApp().then(res=>{
  app.mount(res.mountDom!)
})

2.2 主应用是react时

建设中...

2.3 主应用是angular时

建设中...

主应用接入步骤

总体接入步骤

  1. 安装@das-fed/mframe
  2. 修改单页应用的挂载点和布局组件的挂载点

完成以上步骤即可完成接入。

1. 安装@das-fed/mframe

pnpm add @das-fed/mframe

2. 修改SPA应用的挂载点和布局组件的挂载点

2.1 主应用是vue时

原应用的mian.ts代码最小化代码假设如下:

import { createApp } from 'vue'
import { router } from './router'
import App from './App.vue'

const app = createApp(App)
app.use(router)
app.mount('#app')

需要改为:

import { createApp, h, render } from 'vue'
import { router } from './router'
import App from './App.vue'
import { createMicroApp } from '@das-fed/mframe' // 引入框架依赖
import Nav from './layout-components/nav.vue' // 引入布局组件中的顶部导航组件
import Menu from './layout-components/menu.vue' // 引入布局组件中的左侧菜单组件
import Tab from './layout-components/tab.vue' // 引入布局组件中的标签栏组件

const app = createApp(App)
app.use(router)

// 使用mframe创建子应用,并修改原spa应用的挂载点
createMicroApp({
  // 子应用列表
  microApps: [
    {
      name: 'app1',
      origin: 'http://localhost:5174',
      activeRule: '/micro-app-1/*',
    },
    {
      name: 'app2',
      origin: 'http://localhost:5175',
      activeRule: '/micro-app-2/*',
      router: { mode: 'hash' },
    },
  ],
}).then(res => {
  const { mountDom, navDom, menuDom, tabDom } = res
  app.mount(res.mountDom!) // 修改应用的挂载点
  render(h(Nav), navDom!) // 修改布局组件中的顶部导航组件的挂载点
  render(h(Menu), menuDom!) // 修改布局组件中的左侧菜单组件的挂载点
  render(h(Tab), tabDom!) // 修改布局组件中的标签栏组件的挂载点
})

2.2 主应用是react时

建设中...

2.3 主应用是angular时

建设中...

3. 渲染外框组件(顶部nav、左侧menu、导航tab)

建设中...

4. 加载子应用

建设中...