New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@wecity/qiankun-cache

Package Overview
Dependencies
Maintainers
18
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wecity/qiankun-cache

qiankun缓存组建,实现类型vue中的keep-alive

latest
npmnpm
Version
0.0.1
Version published
Maintainers
18
Created
Source

@wecity/qiankun-cache

npm i @wecity/qiankun-cache -S

proxyMount

import { proxyMount } from '@wecity/qiankun-cache'
export function mount(props) {
    router = Router.init(Vue, props)
    const instanceFn = () => {
        return new Vue({
          router,
          store,
          render: h => h(App)
        }).$mount(container ? container.querySelector('#app') : '#app')
      }
      const renderVNode = vnode => {
        return new Vue({
          router,
          store,
          render: () => vnode
        }).$mount(container ? container.querySelector('#app') : '#app')
      }
    
    instance = proxyMount({
      router,
      instanceFn,
      renderVNode
    })
}
字段名类型描述
routerobject路由实例
instanceFnfunction渲染函数
renderVNodefunction缓存渲染函数

proxyUnmount

import { proxyUnmount } from '@wecity/qiankun-cache'
export function unmount() {
  proxyUnmount({ instance })
  instance.$destroy()
  instance = null
  router = null
}
字段名类型描述
instanceobject实例

注意

  • 第二次进入闪屏问题: css、js打包在一起不要分别打包

Keywords

qiankun

FAQs

Package last updated on 23 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts